Tutorials › Calculus I › Using Logarithms To Simplify Positive Objectives

Optimization and Newton's Method · Tutorial 882 of 1495

Using Logarithms To Simplify Positive Objectives

Use logarithms to simplify positive objectives without changing their maximizers, and translate the resulting derivative equation back to the original objective.

Advanced 10 min read

What You'll Learn

  • Explain why taking the logarithm preserves the maximizers of a positive objective.
  • Convert products and powers into sums using logarithm laws.
  • Derive the critical-point equation for a differentiable positive objective.
  • Apply logarithmic differentiation to products with fixed and variable exponents.
  • Check endpoint behavior and derivative signs when establishing a global maximum.
  • Recognize when taking a logarithm is invalid or does not simplify the problem.

Why Take the Logarithm of an Objective?

A positive objective can contain several factors, each raised to a power. Differentiating the product directly may create long expressions, especially when an exponent also depends on the variable. Taking the logarithm can turn products into sums and powers into coefficients or simpler variable-dependent terms.

This is more than an algebraic convenience. Because the natural logarithm is strictly increasing, maximizing a positive objective is equivalent to maximizing its logarithm. The location of a maximum is preserved, while the derivative calculation may become substantially simpler.

Key idea: If \(F(x)>0\) throughout the domain under consideration, then \(F\) and \(\ln F\) have the same maximizers. At an interior point where \(F\) is differentiable, their critical-point equations are equivalent.

When the Transformation Is Valid

The natural logarithm \(\ln y\) is defined for \(y>0\). Therefore, before replacing \(F\) by \(\ln F\), check that the objective is positive at every point in the domain being considered. For products involving real powers, also check that the bases are positive wherever those powers are defined.

For example, if \(a(x)>0\), \(b(x)>0\), and \(r,s\) are real constants, then

$$ F(x)=a(x)^r b(x)^s $$

is positive, and the logarithm laws give

$$ \ln F(x)=r\ln a(x)+s\ln b(x). $$

The product has become a sum, and constant powers have become coefficients. If the exponent depends on \(x\), the corresponding rule is \(\ln(a(x)^{q(x)})=q(x)\ln a(x)\), provided \(a(x)>0\). The exponent remains inside the resulting expression as a factor.

Why the Critical-Point Equations Agree

Suppose \(F\) is positive and differentiable on an open interval. Define \(G(x)=\ln F(x)\). The chain rule gives the central identity:

$$ G'(x)=\frac{F'(x)}{F(x)}. $$

Since \(F(x)>0\), the denominator is never zero. Consequently, at an interior point \(c\),

$$ G'(c)=0 \quad\Longleftrightarrow\quad \frac{F'(c)}{F(c)}=0 \quad\Longleftrightarrow\quad F'(c)=0. $$

This proves that solving the derivative equation for the logarithm finds exactly the same interior critical points as differentiating the original objective. It also shows that \(F'(x)=F(x)G'(x)\), so \(F'\) and \(G'\) have the same sign wherever \(F>0\). Thus, a sign analysis of the logarithm's derivative also describes whether the original objective is increasing or decreasing.

Theorem: Let \(F\) be positive on a domain \(D\). Since \(\ln\) is strictly increasing, for any \(x_1,x_2\in D\), \(F(x_1)>F(x_2)\) if and only if \(\ln F(x_1)>\ln F(x_2)\). Hence every global maximizer of \(F\) is a global maximizer of \(\ln F\), and conversely. This fact does not remove the need to check endpoints or other parts of the domain.

Worked Example: A Product with Fixed Powers

Worked Example: Maximizing \(x^2(1-x)^3\)

Find the maximum of \(F(x)=x^2(1-x)^3\) for \(0\le x\le1\). The function is positive on \(0<x<1\), so take its logarithm there:

$$ G(x)=\ln F(x) =2\ln x+3\ln(1-x). $$

Differentiate each term, using the chain rule for \(\ln(1-x)\):

$$ G'(x)=\frac{2}{x}-\frac{3}{1-x} =\frac{2(1-x)-3x}{x(1-x)} =\frac{2-5x}{x(1-x)}. $$

An interior critical point must satisfy \(2-5x=0\), so \(x=2/5\). On \(0<x<1\), the denominator \(x(1-x)\) is positive. Therefore \(G'(x)>0\) when \(x<2/5\) and \(G'(x)<0\) when \(x>2/5\). Since \(F'=FG'\) and \(F>0\), \(F\) increases up to \(2/5\) and decreases afterward.

The endpoint values are \(F(0)=0\) and \(F(1)=0\), so the interior point gives the global maximum. Its value is

$$ F\left(\frac25\right) =\left(\frac25\right)^2\left(1-\frac25\right)^3 =\frac4{25}\left(\frac35\right)^3 =\frac4{25}\cdot\frac{27}{125} =\frac{108}{3125}. $$

As a check, the logarithmic derivative at \(2/5\) is \(2/(2/5)-3/(3/5)=5-5=0\). Thus \(F'=FG'=0\) there, and the derivative sign changes from positive to negative, confirming the maximum.

Variable Exponents

Logarithms are especially useful when the variable appears as an exponent. If \(x>0\), then

$$ \ln(x^x)=x\ln x. $$

The right-hand side is usually easier to differentiate than \(x^x\) directly. More generally, for \(a(x)>0\), the expression \(a(x)^{q(x)}\) can be written as \(\exp(q(x)\ln a(x))\). Differentiating its logarithm avoids treating the changing base and changing exponent as separate complications.

Worked Example: Maximizing \(x^{1/x}\)

Consider \(F(x)=x^{1/x}\) for \(x>0\). This objective is positive throughout its domain. Its logarithm is

$$ G(x)=\ln F(x)=\frac{\ln x}{x}. $$

Differentiate using the quotient rule:

$$ G'(x)=\frac{x(1/x)-\ln x}{x^2} =\frac{1-\ln x}{x^2}. $$

Because \(x^2>0\), the critical-point equation is \(1-\ln x=0\), giving \(x=e\). For \(0<x<e\), \(\ln x<1\), so \(G'(x)>0\). For \(x>e\), \(\ln x>1\), so \(G'(x)<0\). The original objective has the same derivative sign because \(F'=FG'\).

At the critical point,

$$ F(e)=e^{1/e}. $$

This is a global maximum on \(x>0\). Indeed, the derivative sign shows that \(F\) increases up to \(e\) and decreases afterward. The limiting values at the ends of the domain are consistent with this conclusion: as \(x\) approaches \(0\) from above, \(\ln F(x)=\ln x/x\) tends to \(-\infty\), so \(F(x)\) tends to \(0\); as \(x\) tends to infinity, \(\ln F(x)\) tends to \(0\), so \(F(x)\) tends to \(1\), which is less than \(e^{1/e}\).

Finally, the critical-point check is \(G'(e)=(1-\ln e)/e^2=0\), and therefore \(F'(e)=F(e)G'(e)=0\).

Worked Example: A Product with Variable Exponents

Worked Example: Maximizing \(x^{-x}(1-x)^{-(1-x)}\)

Let \(F(x)=x^{-x}(1-x)^{-(1-x)}\) for \(0<x<1\). Both bases are positive, so \(F\) is positive and logarithms are valid. Set \(G(x)=\ln F(x)\):

$$ G(x)=-x\ln x-(1-x)\ln(1-x). $$

Differentiate the first term using the product rule. For the second, differentiate \((1-x)\ln(1-x)\) before applying the negative sign:

$$ \frac{d}{dx}[-x\ln x]=-\ln x-1, $$
$$ \frac{d}{dx}[-(1-x)\ln(1-x)]=\ln(1-x)+1. $$

Adding these expressions gives

$$ G'(x)=\ln(1-x)-\ln x =\ln\left(\frac{1-x}{x}\right). $$

The critical-point equation is \(\ln((1-x)/x)=0\). Since \(\ln y=0\) exactly when \(y=1\), this gives \(1-x=x\), hence \(x=1/2\).

When \(x<1/2\), \((1-x)/x>1\), so \(G'(x)>0\). When \(x>1/2\), \((1-x)/x<1\), so \(G'(x)<0\). Thus \(F\) increases and then decreases, and the critical point is a global maximum. Its value is

$$ F\left(\frac12\right) =\left(\frac12\right)^{-1/2} \left(\frac12\right)^{-1/2} =\sqrt{2}\,\sqrt{2} =2. $$

At this point, \(G'(1/2)=\ln 1=0\), so \(F'(1/2)=F(1/2)G'(1/2)=0\). As a further boundary check, \(x\ln x\) tends to \(0\) as \(x\) approaches \(0\) from above; the corresponding endpoint limits of \(F\) are both \(1\), below the maximum value \(2\).

A Common Mistake: Taking Logs Without Checking Positivity

A logarithm can only be taken of a positive quantity. For example, the objective \(H(x)=-x^2\) is never positive. The expression \(\ln(-x^2)\) is therefore undefined for every real \(x\); differentiating it cannot be a valid optimization method. In fact, \(H\) has maximum \(0\) at \(x=0\), which must be found by analyzing \(H\) itself.

Another error is to mishandle a variable exponent. The correct identity is \(\ln(x^x)=x\ln x\) for \(x>0\), not \((\ln x)^x\). For instance, at \(x=2\), \(\ln(2^2)=\ln 4=2\ln 2\), whereas \((\ln 2)^2\) is a different quantity.

Practical check: Confirm that the objective is positive on the domain, apply logarithm laws to the entire objective, and use the chain rule carefully when differentiating variable bases or exponents.

Using the Method Reliably

Logarithmic simplification finds candidate points; it does not by itself establish that a candidate is a global maximum. A reliable analysis still identifies the domain, checks any boundary points where the objective is defined, solves the logarithmic critical-point equation, and compares candidates or establishes the sign of the derivative.

When the objective is a product of positive factors, the logarithm often makes the derivative manageable. If \(F(x)=\prod_{i=1}^{n} a_i(x)^{r_i}\), where every \(a_i(x)>0\) and the exponents \(r_i\) are constant, then

$$ \ln F(x)=\sum_{i=1}^{n}r_i\ln a_i(x), \qquad \frac{F'(x)}{F(x)} =\sum_{i=1}^{n}r_i\frac{a_i'(x)}{a_i(x)}. $$

The second formula follows by differentiating the first and using \(G'=F'/F\). It gives an equivalent critical-point equation: set the sum on the right equal to zero, provided the point lies in the domain. For variable exponents, first write each logarithmic term explicitly, such as \(q(x)\ln a(x)\), and then differentiate it with the product rule.

The essential benefit is that multiplication and exponentiation become addition and multiplication inside the logarithm. The essential limitation is that this transformation depends on positivity. Keeping both facts in view lets logarithms simplify an optimization problem without changing what is being optimized.

Check Your Understanding

Use the conditions and derivative relationship developed above to answer these questions.

  1. Why do \(F\) and \(\ln F\) have the same global maximizers when \(F\) is positive?
  2. For a positive differentiable objective \(F\), what identity relates \((\ln F)'\) to \(F'\), and why does it preserve interior critical points?
  3. Write \(\ln\bigl(a(x)^3b(x)^2\bigr)\) as a sum, assuming both factors are positive.
  4. For \(F(x)=x^x\) with \(x>0\), what is \(\ln F(x)\)?
  5. Why is taking the logarithm not a valid method for maximizing \(H(x)=-x^2\) over the real numbers?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon