What is the integral of #xln^2(x+3)#?

1 Answer
Jun 6, 2016

I got

#(x^2 - 9)/2ln^2(x+3) - 1/2(x - 9)(x+3)ln(x+3) + 1/4(x+3)(x-21) + C#


DISCLAIMER: LONG ANSWER!

Whenever #ln# is in an integral, you should consider trying integration by parts to see where that gets you.

For #int udv#, what we have is:

#\mathbf(int udv = uv - intvdu)#

So the strategy here is to choose one term that is easier to differentiate, like #ln^2(x+3)#, and one term that is easier to antidifferentiate, like #x#.

FIRST INTEGRATION BY PARTS

Let:
#u = (ln(x+3))^2 -> du = (2ln(x+3))/(x+3)dx#
#dv = xdx -> v = x^2/2#

#=> x^2/2ln^2(x+3) - int (x^2ln(x+3))/(x+3)dx#

Now, you see how there's #ln(x+3)# and #1/(x+3)#? We can do another substitution. This is going to feel a bit pointless, but it'll give us a way out of this by allowing us to divide.

SOME U SUBSTITUTION

Let #u = x+3#. Then, #du = dx# and #x^2 = (u-3)^2 = u^2 - 6u + 9#.

So, what we now have is:

#=> x^2/2ln^2(x+3) - int ((u-3)^2lnu)/udu#

#=> x^2/2ln^2(x+3) - int ((u^2 - 6u + 9)lnu)/udu#

#=> x^2/2ln^2(x+3) - int (u^2lnu - 6u lnu + 9lnu)/udu#

#=> x^2/2ln^2(x+3) - int u lnu - 6lnu + (9lnu)/udu#

That's not too bad now.

SECOND INTEGRATION BY PARTS

The first integral is done by three different integration by parts, but fairly straightforward ones.

For #int sdt#, we have #\mathbf(int sdt = st - int tds)#. So...

For #int u lnudu#, let:
#s = lnu -> ds = 1/udu#
#dt = udu -> t = u^2/2#

#=> u^2/2 lnu - int u/2du = u^2/2 lnu - u^2/4#

THIRD INTEGRATION BY PARTS

For #6int lnudu#, let:
#s = lnu -> ds = 1/udu#
#dt = du -> t = u#

#=> u lnu - int u/udu = u lnu - u#

FOURTH INTEGRATION BY PARTS

For #9int lnu/udu#, let #s = lnu# and #ds = 1/udu#. Then:

#=> 9int sds = 9/2s^2 = 9/2ln^2u#

PUTTING IT ALL TOGETHER

So, for our overall integral, we currently have:

#=> x^2/2ln^2(x+3) - [int u lnudu - int6lnudu + int(9lnu)/udu]#

#= x^2/2ln^2(x+3) - [(u^2/2 lnu - u^2/4) - 6(u lnu - u) + 9/2ln^2u]#

Make sure you catch those parentheses!

#= x^2/2ln^2(x+3) - [u^2/2 lnu - u^2/4 - 6u lnu + 6u + 9/2ln^2u]#

#= x^2/2ln^2(x+3) - u^2/2 lnu + u^2/4 + 6u lnu - 6u - 9/2ln^2u#

But since #u = x+3#, we now have:

#= x^2/2ln^2(x+3) - (x+3)^2/2 ln(x+3) + (x+3)^2/4 + 6(x+3) ln(x+3) - 6(x+3) - 9/2ln^2(x+3)#

Regroup terms together:

#= x^2/2ln^2(x+3) - 9/2ln^2(x+3) + 6(x+3) ln(x+3) - (x+3)^2/2 ln(x+3) + (x+3)^2/4 - 6(x+3)#

#= (x^2/2 - 9/2)ln^2(x+3) + (-(x+3)^2/2 + 6x + 18)ln(x+3) + (x+3)^2/4 - 6(x+3) + C#

Yeah, I think I'll stop here.

If you wanted to work to simplify this some more, you can get this eventually through some expansion and re-factoring:

#= color(blue)((x^2 - 9)/2ln^2(x+3) - 1/2(x - 9)(x+3)ln(x+3) + 1/4(x+3)(x-21) + C)#

Turns out that this was right!