# How to Integrate the Function Ln(x)^2 (Natural Log Squared)

TR Smith is a product designer and former teacher who uses math in her work every day.

Find the antiderivative of the function ln(x)^2 using the integration by parts method.

Integration by parts can be used to find the antiderivatives of powers of complicated functions, for example, the function j(x) = Ln(x)^2, the square of the natural logarithm function. The integration by parts formula is

f(x)·g'(x) dx = f(x)·g(x) - f'(x)·g(x) dx

where f(x) and g'(x) are chosen in such a way as to make the right hand side of the expression something easier to integrate. See companion article on the derivation of the integration by parts technique.

When using this method of finding antiderivatives in integral calculus, there is often more than one way to assign the functions f(x) and g'(x) depending on the structure of the integrand. For instance, if the function to be integrated looks clearly like the product of two simpler functions, it is natural to assign f(x) to the more complicated of the two factors, and g'(x) to the factor that can easily be integrated. In the case of Ln(x)^2, there are routes of integration.

## Method 1: f(x) = Ln(x) and g'(x) = Ln(x) dx

If f(x) = Ln(x), then f'(x) = 1/x dx. And if g'(x) = Ln(x) dx, then g(x) = x*Ln(x) - x. Putting all the pieces together gives us

Ln(x)^2 dx = x*Ln(x)^2 - x*Ln(x) - x*Ln(x)/x dx + x/x dx

= x*Ln(x)^2 - x*Ln(x) - ∫ Ln(x) dx + dx

= x*Ln(x)^2 - x*Ln(x) - x*Ln(x) + x + x

= x*Ln(x)^2 - 2x*Ln(x) + 2x + C

## Method 2: f(x) = Ln(x)^2 and g'(x) = dx

If f(x) = Ln(x)^2, then f'(x) = 2*Ln(x)/x. And if g'(x) = dx, then g(x) = x. Putting all of these pieces together into the integration by parts formula gives us

Ln(x)^2 dx = x*Ln(x)^2 - 2* Ln(x) dx

= x*Ln(x)^2 - 2x*Ln(x) + 2x + C

This method had fewer steps than the previous method, and both produce the same answer.

Antiderivative of Ln(x)^2

## Integration Example 1

Find the area under the curve of y = Ln(x)^2 from x = 1 to x = e^2. A graph of y = Ln(x)^2 is shown below.

Since the antiderivative of Ln(x)^2 is x*Ln(x)^2 - 2x*Ln(x) + 2x, the area under the curve is found by plugging in the endpoints x = e^2 and x = 1 and then subtracting the two values. Doing so gives you

(e^2)Ln(e^2)^2 - (2e^2)Ln(e^2) + 2e^2 - Ln(1)^2 + 2*Ln(1) - 2

= 4e^2 - 4e^2 + 2e^2 - 0 + 0 - 2

= 2e^2 - 2

≈ 12.7781

## Integration Example 2

Using the known antiderivative of Ln(x)^2, what is the antiderivative of the function f(x) = x*Ln(x)^2?

We can tackle this one using integration by parts. Let

u = x
dv = Ln(x)^2 dx
du = dx
v = x*Ln(x)^2 - 2x*Ln(x) + 2x

Our integral becomes

∫ x*Ln(x)^2 dx
= ∫ u dv
= uv - ∫ v du
= (x^2)Ln(x)^2 - (2x^2)Ln(x) + 2x^2 - ∫ x*Ln(x)^2 dx + ∫ 2x*Ln(x) dx - ∫ 2x dx

Notice that we get an equation with the same unknown integral on both sides. Bringing it over to the left-hand side of the equation and working out the simpler integrals gives us

2 * ∫ x*Ln(x)^2 dx
= (x^2)Ln(x)^2 - (2x^2)Ln(x) + 2x^2 + (x^2)Ln(x) - (1/2)x^2 - x^2
= (x^2)Ln(x)^2 - (x^2)Ln(x) + (1/2)x^2

This tells us that the antiderivative of x*Ln(x)^2 is

∫ x*Ln(x)^2 dx
= (1/2)[(x^2)Ln(x)^2 - (x^2)Ln(x) + (1/2)x^2] + c

0

0

4

1

## Popular

31

30

• ### How to Integrate sin(x)^3 and cos(x)^3, Sine Cubed and Cosine Cubed

1

0 of 8192 characters used

• Spooner 2 years ago

This is so good! Thanks

• meenal 3 days ago

Could anybody tell me the integration of log(1+x^2)

• Author

TR Smith 3 days ago from Eastern Europe

Hi Meenal,

The integration of ln(x^2 + 1) is covered in another tutorial

https://owlcation.com/stem/How-to-Integrate-Lnx2-1