What did I do wrong with this integral?

113 Views Asked by At

PROBLEM

I have to compute this indefinite integral: $$\int(2-x)^2\ln(4x)\,\,dx$$


MY ATTEMPT

So I did integration by parts:

$$\begin{matrix} u=(2-x)^2 & dv=\ln(4x)\,\,dx\\ du=(2x-4)\,\,dx & v=\int\ln(4x)\\ \end{matrix}$$ $$\int\ln(4x)\,\,dx=\;\;?$$ $$\begin{matrix} a=\ln(4x) & db=dx\\ da={1\over x}\,\,dx & b=x\\ \end{matrix}$$

$$\int\ln(4x)\,\,dx=x\ln(4x)-\int x\,\cdot\frac1x\,\,dx$$ $$\int\ln(4x)\,\,dx=x\ln(4x)-x$$ So because of that: $$\int(2-x)^2\ln(4x)\,\,dx=(2-x)^2\Big(x\ln(4x)-x\Big)-\int(2x-4)\Big(x\ln(4x)-x\Big)\,\,dx$$ Now integrating by parts one more time: $$\begin{matrix} u=2x-4 & dv=\Big(x\ln(4x)-x\Big)\,\,dx\\ du=2\,\,dx & v=\int\Big(x\ln(4x)-x\Big)\,\,dx\\ \end{matrix}$$ $$\int\Big(x\ln(4x)-x\Big)\,\,dx=\int x\ln(4x)\,\,dx\;-\int x\,\,dx$$ $$\begin{matrix} a=\ln(4x) & db=x\,\,dx\\ da={1\over x}\,\,dx & b=\frac{x^2}{2}\\ \end{matrix}$$ $$\int x\ln(4x)\,\,dx=\frac{x^2}{2}\ln(4x)\;-\int\frac{x^2}{2}\,\cdot\frac1x\,\,dx$$ $$\int x\ln(4x)\,\,dx=\frac{x^2}{2}\ln(4x)\;-\int\frac x2\,\,dx$$ $$\int x\ln(4x)\,\,dx=\frac{x^2}{2}\ln(4x)\;-\frac{x^2}{4}$$ $$\int\Big(x\ln(4x)-x\Big)\,\,dx=\frac{x^2}{2}\ln(4x)\;-\frac{x^2}{4}-\frac{x^2}{2}$$ Finally, after all this mess, plugging in in the equation of the original integral: $$\int(2-x)^2\ln(4x)\,\,dx=(2-x)^2\Big(x\ln(4x)-x\Big)-\frac{x^2}{2}\ln(4x)\;+\frac{x^2}{4}+\frac{x^2}{2}+c$$ Now, I cleaned up this mess a little to give a nicer answer: $$(2-x)^2\Big(x\ln(4x)-x\Big)-\frac{x^2}{2}\ln(4x)\;+\frac{x^2}{4}+\frac{x^2}{2}+c$$ $$x(x^2-4x+4)\Big(\ln(4x)-1\Big)-\frac{x^2}{2}\ln(4x)\;+\frac{x^2}{4}+\frac{x^2}{2}+c$$ $$(x^3-4x^2+4x)\ln(4x)-x^2+4x-4-\frac{x^2}{2}\ln(4x)\;+\frac34 x^2+c$$ $$(x^3-4x^2+4x)\ln(4x)-\frac{x^2}{2}\ln(4x)-x^2+4x-4\;+\frac34 x^2+c$$ $$\boxed{\Big(x^3-\frac{9}{2}x^2+4x\Big)\ln(4x)-\frac{1}{4}x^2+4x-4+c}$$


ANSWER FROM WOLFRAMALPHA

WolframAlpha gives me a different answer: $$\frac{1}{9}x\Big(-x^2+3(x^2-6x+12)\ln(4x)+9x-36\Big)+c$$ Even after rearranging the WA's answer, I get similar answer but the coefficients and other details don't match. I won't bother rearranging the WolframAlpha's answer here, but trust me, after putting it into similar form to my answer, it doesn't work.


So what did I do wrong?

2

There are 2 best solutions below

6
On BEST ANSWER

Up to here

$$\int(2-x)^2\ln(4x)\,\,dx=(2-x)^2\Big(x\ln(4x)-x\Big)-\int(2x-4)\Big(x\ln(4x)-x\Big)\,\,dx$$

it seems to be correct but this

$$\int(2-x)^2\ln(4x)\,\,dx=(2-x)^2\Big(x\ln(4x)-x\Big)-\frac{x^2}{2}\ln(4x)\;+\frac{x^2}{4}+\frac{x^2}{2}+c$$

seems not correct since you didn't considered the term

$$A=(2x-4)\left(\frac{x^2}{2}\ln(4x)\;-\frac{x^2}{4}-\frac{x^2}{2}\right)$$

and also the calculation of this part $\left(\frac{x^2}{2}\ln(4x)\;-\frac{x^2}{4}-\frac{x^2}{2}\right)$ seems uncorrect indeed the integral should be

$$\int(2x-4)\Big(x\ln(4x)-x\Big)\,\,dx=-\frac89x^3+3x^2+\frac23(x^3-3x^2)\ln (4x)$$

Let try to fix form here, since

$$\int\Big(x\ln(4x)-x\Big)\,\,dx=\frac{x^2}{2}\ln(4x)\;-\frac{x^2}{4}-\frac{x^2}{2}=\frac{x^2}{2}\ln(4x)\;-\frac{3x^2}{4}$$

we have that

$$\int(2x-4)\Big(x\ln(4x)-x\Big)\,\,dx=\\ =(2x-4)\left(\frac{x^2}{2}\ln(4x)\;-\frac{3x^2}{4}\right)-2\int\Big(\frac{x^2}{2}\ln(4x)\;-\frac{3x^2}{4}\Big)\,\,dx=\\ =(2x-4)\left(\frac{x^2}{2}\ln(4x)\;-\frac{3x^2}{4}\right)+\frac{x^3}{2}-\int x^2\ln(4x)\,\,dx=\\ =(x^3-2x^2)\ln(4x)\;-(x^3-3x^2)-\frac13x^3\log (4x)+\frac19x^3=\\ -\frac89x^3+3x^2+\frac23(x^3-3x^2)\ln (4x)$$

0
On

WHAT I DID WRONG

I figured out what I did wrong. I didn't finish the third integration by parts in my work. I ended up doing: $$\int(2-x)^2\ln(4x)\,\,dx=(2-x)^2\Big(x\ln(4x)-x\Big)-\int\Big(x\ln(4x)-x\Big)\,\,dx$$ Instead of this: $$\int(2-x)^2\ln(4x)\,\,dx=(2-x)^2\Big(x\ln(4x)-x\Big)-\int(2x-4)\Big(x\ln(4x)-x\Big)\,\,dx$$ I didn't drop the $(2x-4)$, it's there, in the third integration by parts, I just forgot to finish the integration by parts, and wrongly replaced $\int(2x-4)\Big(x\ln(4x)-x\Big)\,\,dx$ with $\int\Big(x\ln(4x)-x\Big)\,\,dx$.


The real answer should've been: $$(2-x)^2\Big(x\ln(4x)-x\Big)-(2x-4)\Bigg(\frac{x^2}{2}\ln(4x)\;-\frac{x^2}{4}-\frac{x^2}{2}\Bigg)+2\int\frac{x^2}{2}\ln(4x)\;-\frac{3}{4}x^2\,\,dx$$ We have another integration by parts (sad face): $$\begin{matrix} u=ln(4x) & dv=\frac{x^2}{2}\,\,dx\\ du=\frac1x\,\,dx & v=\frac{x^3}{6}\\ \end{matrix}$$ $$\int\frac{x^2}{2}\ln(4x)\,\,dx=\frac{x^3}{6}\ln(4x)\;-\frac{x^3}{18}$$ $$\int\frac{x^2}{2}\ln(4x)\;-\frac{3}{4}x^2\,\,dx=\frac{x^3}{6}\ln(4x)\;-\frac{x^3}{18}-\frac{x^3}{4}$$ This gets us: $$(2-x)^2\Big(x\ln(4x)-x\Big)-(2x-4)\Bigg(\frac{x^2}{2}\ln(4x)\;-\frac{x^2}{4}-\frac{x^2}{2}\Bigg)+\frac{x^3}{3}\ln(4x)\;-\frac{x^3}{9}-\frac{x^3}{2}+c$$ Now rearranging this to get a nice answer: $$(2-x)^2\Big(x\ln(4x)-x\Big)-(x-2)\Bigg(x^2\ln(4x)\;-\frac{x^2}{2}-x^2\Bigg)+\frac{x^3}{3}\ln(4x)\;-\frac{11}{18}x^3+c$$ $$x(x^2-4x+4)\Big(\ln(4x)-1\Big)-(x-2)\Bigg(x^2\ln(4x)\;-\frac{3}{2}x^2\Bigg)+\frac{x^3}{3}\ln(4x)\;-\frac{11}{18}x^3+c$$ $$(x^3-4x^2+4x)\ln(4x)-(x^3-4x^2+4x)-(x^3-2x^2)\Big(\ln(4x)\;-\frac{3}{2}\Big)+\frac{x^3}{3}\ln(4x)\;-\frac{11}{18}x^3+c$$ $$(-2x^2+4x)\ln(4x)-(x^3-4x^2+4x)+\frac{3}{2}(x^3-2x^2)+\frac{x^3}{3}\ln(4x)\;-\frac{11}{18}x^3+c$$ $$\Big(\frac13x^3-2x^2+4x\Big)\ln(4x)-(x^3-4x^2+4x)+\frac{3}{2}(x^3-2x^2)-\frac{11}{18}x^3+c$$ $$\Big(\frac13x^3-2x^2+4x\Big)\ln(4x)+\frac12x^3+x^2-4x-\frac{11}{18}x^3+c$$ $$\boxed{\Big(\frac13x^3-2x^2+4x\Big)\ln(4x)-\frac19x^3+x^2-4x+c}$$


After rearranging the WolframAlpha's answer, the two answers match, so this one is correct. Wow, what a messy integral.