# Trouble with trig substitution

I have a few questions and a request for an explanation.

I worked this problem for a quite a while last night. I posted it here.

Here is the original question: $$\int\frac{-7 x^2}{\sqrt{4x-x^2}} dx$$

And here is the work that I did on it:

Help with trig sub integral

Sorry that the negative sometimes gets cut off in the photo, and yes I know it's not fully simplified there.

\begin{align} -7 \int\frac{x^2}{\sqrt{4x-x^2}} dx &= -7 \int\frac{x^{3/2}}{\sqrt{4-x}} dx \\ &= -7 \int\frac{8\sin^3\theta\ 2\cos\theta} {\sqrt{4-4\sin^2\theta}} d\theta && \begin{array}{c} 2\sin\theta = \sqrt x \\ 2\cos\theta = dx \\ (2\sin\theta)^3 = x^{3/2} \end{array} \\ &= -7 \cdot 8 \int\frac{\sin^3\theta\ 2\cos\theta} {2\sqrt{1 - \sin^2\theta}} d\theta \\ &= -56 \int \sin^3\theta\, d\theta \\ &= -56 \int (1 - \cos^2\theta) \sin\theta\, d\theta \\ &= -56 \int(\sin\theta - \cos^2\theta\sin\theta)\,d\theta \\ &= 56 \cos\theta - 56 \int u^2\, du && \begin{array}{c} u = \cos\theta \\ du = \sin\theta \end{array}\\ &= 56 \cos\theta - 56 \frac{\cos^3\theta}{3} + C \\ &= 56 \left(\frac{\sqrt{4-x}}{2} - \frac13 \left( \frac{\sqrt{4-x}}{2}\right)^3 \right)+ C && \cos\theta = \frac{\sqrt{4-x}}{2}\\ &= 56 \frac{\sqrt{4-x}}{2} \left(1 - \frac{4-x}{12}\right) + C\\ \end{align}

My first question is the more involved one: Is the algebra in my original work sound? If it is, why doesn't it work in this instance?

My second question is: is this a correct solution?

$$14\left(\frac{\sqrt{4x-x^2}(x-2)}{2}-2\sqrt{4x-x^2}-3\arcsin\left(\frac{x-2}{2}\right)\right)+C$$

It is for webwork, and I used two out of three chances. I'd prefer to keep my perfect webwork mark, obviously ;p

Finally, I was kind of impressed with Ans4's square completion and had to run it through to see that it was correct. That's such a useful skill. Do you have some specific advice about how I could improve my math tricks to that point?

• Could you use MathJax instead of images, please? – J.G. Feb 15 '20 at 20:05
• Done, but please don't tell me you want me to write an entire page of work in that. It would be painful. – mtlchk Feb 15 '20 at 20:16
• I'll spare you that, and thanks for putting in the putative solution, but please also include the original problem itself. Oh, and have you seen whether differentiating the solution gives the original integrand? – J.G. Feb 15 '20 at 20:18
• Yes, I anticipated that, just done. – mtlchk Feb 15 '20 at 20:20
• I find it's often easier to write a page full of equations like this in MathJax than by hand. Perhaps it's just practice. (Cut and paste helps too.) – David K Feb 15 '20 at 22:32

## 4 Answers

Disclaimer: Since you are saying that it is your last attempt on Webwork, so I would suggest that you should read through the steps carefully to see if there is any typo or mistake on my part.The approach is along the same lines however.

Since $$4x-x^2=-(x^2-4x+2^2-2^2) =-(x-2)^2+2^2$$

So $$\int \frac{x^2}{\sqrt{4x-x^2}}dx =\int \frac{x^2}{\sqrt{2^2-(x-2)^2}}dx$$

Let $$x-2 = 2 \sin u$$ then $$dx = 2 \cos u du$$

Now back to integral

$$\int \frac{x^2}{\sqrt{2^2-(x-2)^2}}dx = \int \frac{(2+2\sin u)^2}{\sqrt{2^2-(2\sin u)^2}}2\cos udu$$

$$= \int \frac{(2+2\sin u)^2}{\sqrt{2^2(1-\sin^2 u)}}2\cos udu$$

$$= \int \frac{(2+2\sin u)^2}{\sqrt{2^2(\cos^2 u)}}2\cos udu$$

$$= \int \frac{(2+2\sin u)^2}{2(\cos u)}2\cos udu$$

$$= \int (2+2\sin u)^2du$$

$$= 4(\int (1+\sin^2 u+2\sin u ))du$$

$$= 4(\int 1 du + \int \sin^2 u du +2 \int \sin u) du$$

$$= 4(u + \int \sin^2 u du -2 \cos u )$$

$$= 4(u + \int \sin^2 u du -2 \cos u )$$

$$=4(u + \frac{1}{2}\left(\int (1-\cos 2u) du \right) -2 \cos u)$$

$$=4( u + \frac{1}{2}\left(u- \frac{\sin 2u}{2} \right) -2 \cos u )$$

$$= 4(u + \frac{1}{2}\left(u- \frac{2\sin u\cos u}{2} \right) -2 \cos u )$$

$$=4( u + \frac{1}{2}\left(u- {\sin u\cos u} \right) -2 \cos u )$$

$$=4( \frac{3u}{2} - \frac{1}{2}{\sin u\cos u} -2 \cos u )$$

$$= 6u - 2\sin u\cos u -8 \cos u$$

Since $$\sin u = \frac{x -2}{2}$$ So

$$\cos u = \sqrt{1-\sin^2 u} = \sqrt{1-(\frac{x -2}{2})^2} = \sqrt{\frac{4 -x^2 +4x -4}{4}} =\frac{\sqrt{4x -x^2}}{2}$$

and

$$u = \arcsin(\frac{x -2}{2})$$

which leads to

$$\int \frac{x^2}{\sqrt{4x-x^2}}dx = 6 \arcsin(\frac{x -2}{2}) - 2 \frac{x -2}{2}\frac{\sqrt{4x -x^2}}{2} -8 \frac{\sqrt{4x -x^2}}{2}$$

$$= 6 \arcsin(\frac{x -2}{2}) - \frac{(x -2)\sqrt{4x -x^2}}{2} -4 \sqrt{4x -x^2}$$

Now you can combine your original integral and the integral constant $$C$$ as

$$\int \frac{-7x^2}{\sqrt{4x-x^2}}dx = -7\left( 6 \arcsin(\frac{x -2}{2}) - \frac{(x -2)\sqrt{4x -x^2}}{2} -4 \sqrt{4x -x^2} \right)+C$$

• Thanks, I find this reassuring that I am on the right track. I think I will rework it to see that I get there myself. – mtlchk Feb 15 '20 at 23:38
• I saw this problem last night got the same answer as you and checked it. – user5713492 Feb 16 '20 at 0:01
• oh, that is handy. Wolfram alpha can track those subs by itself. Thanks for sharing. – mtlchk Feb 16 '20 at 0:04

I'll try to convey general lessons by colouring some coefficients. The crux of this problem is to change the square-rooted expression $$4x-x^2=\color{blue}{2}^2-(x-\color{limegreen}{2})^2$$ to a squared trigonometric function with $$x=\color{limegreen}{2}+\color{blue}{2}\sin t=2(1+\sin t)$$, so the integral becomes\begin{align}\int\frac{-7x^2dx}{\sqrt{4-(2-x)^2}}&=-28\int(1+\sin t)^2dt\\&=14\int(-3-4\sin t+\cos 2t)dt\\&=14(-3t+4\cos t\color{red}{+}\tfrac12\sin 2t)+C\\&=14(-3\arcsin\tfrac{x-2}{2}\color{red}{+}2\sqrt{4x-x^2}+\tfrac{x-2}{\color{red}{4}}\sqrt{4x-x^2})+C,\end{align}where in the last line we use$$\sin t=\frac{x-2}{2},\,\cos t=\sqrt{1-\left(\frac{x-2}{2}\right)^2}=\frac12\sqrt{4x-x^2},\,\sin 2t=2\sin t\cos t.$$Of course, you already knew most of this. But everything I've marked in red corrects a sign error in your result (plus a coefficient error @Jam noted), probably due to forgetting that $$\cos^\prime u=\color{red}{-}\sin u$$ but $$\int\cos u=\color{red}{+}\sin u+C$$.

• I think your final line in the solution of the integral should have $\frac{x-2}{\color{red}{4}}\sqrt{4x-x^{2}}$. – Jam Feb 15 '20 at 23:22
• Thanks very much, kind sir/madam. I am pleased that I was nearly there and also irritated that I still managed to drop a negative (almost wrote nagative. Is that a freudian typo slip or mild dyslexia?) Unfortunately I drop a lot of negatives. It's quite frustrating. – mtlchk Feb 15 '20 at 23:36
• @Jam Thanks; fixed. – J.G. Feb 16 '20 at 7:43

You do not have a "$$\theta$$" on your diagram, so it is not possible to verify that $$\theta$$ and $$x$$ have a correct relationship. You do not write "$$x = \dots$$", so I have to guess that you mean $$x = 4 \sin^2 \theta \text{.}$$ The original integrand is only defined on $$x \in [0,4]$$, so happily this choice of substitution for $$x$$ is capable of representing the entire valid range of $$x$$s in the original integral.

From this, $$\mathrm{d}x = 8 \cos \theta \sin \theta \,\mathrm{d}\theta \text{,}$$ which is not equivalent to your "$$2 \cos \theta = \mathrm{d}x$$".

The derivative of your proposed solution with respect to $$x$$ is $$\frac{-7x^2 + 84x - 126}{\sqrt{4x-x^4}} \text{,}$$ which is not (up to a constant of integration) equivalent to the given integrand.

Using only algebra, substitution, and trig substitution, I would attack your integral as \begin{align*} \int & \; \frac{-7 x^2}{\sqrt{4x-x^2}} \,\mathrm{d}x \\ &= \int \; \frac{-7 x^2}{\sqrt{-(x^2 - 4x + 4 - 4)}} \,\mathrm{d}x \\ &= \int \; \frac{-7 x^2}{\sqrt{-((x-2)^2 - 4)}} \,\mathrm{d}x &\begin{bmatrix} u = x-2 \\ \mathrm{d}u = \mathrm{d}x \end{bmatrix} \\ &= \int \; \frac{-7 (u+2)^2}{\sqrt{4 - u^2}} \,\mathrm{d}u &\begin{bmatrix} u = 2\cos\theta \\ \mathrm{d}u = -2\sin\theta\,\mathrm{d}\theta\end{bmatrix} \\ &= \int \; \frac{-7 (2\cos\theta+2)^2}{\sqrt{4 - 4\cos^2 \theta}} (-2 \sin\theta) \,\mathrm{d}\theta \\ &= \int \; \frac{-7 (2\cos\theta+2)^2}{2 \sin \theta} (-2 \sin\theta) \,\mathrm{d}\theta \\ &= 7 \int \; (2\cos\theta+2)^2 \,\mathrm{d}\theta \text{.} \end{align*} Then multiply out the binomial and split the sum into three integrals. The constant integral is easy. The cosine integral is easy. The squared cosine integral is easy if you use reduction formulas (the fifth and sixth entries in the table here) or the identity $$\cos 2x = 2 \cos^2 x - 1$$ to double the angle and lower the power.

The mistake in your original attempt has been identified: the substitution for $$dx.$$ In particular, $$\frac{d}{d\theta} 4 \sin^2 \theta = 8 \sin\theta\cos\theta \neq 2 \cos\theta.$$

Patching your original attempt by making the correct substitution,

\begin{align} -7 \int\frac{x^2}{\sqrt{4x-x^2}} dx &= -7 \int\frac{x^{3/2}}{\sqrt{4-x}} dx \\ &= -7 \int\frac{8\sin^3\theta\ 8 \sin\theta\cos\theta} {\sqrt{4-4\sin^2\theta}} d\theta && \begin{array}{c} 2\sin\theta = \sqrt x \\ 8 \sin\theta\cos\theta \,d\theta = dx \\ (2\sin\theta)^3 = x^{3/2} \end{array} \\ &= -7 \cdot 8 \int\frac{\sin^3\theta\ 8 \sin\theta\cos\theta} {2\sqrt{1 - \sin^2\theta}} d\theta \\ &= -224 \int \sin^4\theta\, d\theta \\ &= -224 \int (1 - \cos^2\theta) \sin^2\theta\, d\theta \\ &= -224 \int(\sin^2\theta - \cos^2\theta\sin^2\theta)\,d\theta \\ \end{align} Here we have to switch strategies due to the extra factor $$\sin\theta.$$ \begin{align} \int\sin^2\theta \,d\theta &= \int \frac12 (1 - \cos(2\theta)) \,d\theta\\ &= \frac12\theta - \frac12 \int \cos(2\theta) \,d\theta\\ &= \frac12\theta - \frac14 \sin(2\theta) + C_1 \end{align} \begin{align} \int\sin^2\theta\cos^2\theta \,d\theta &= \int \frac14 \sin^2(2\theta) \,d\theta\\ &= \frac18 \int \sin^2 u \,du && u = 2\theta\\ &= \frac18 \left(\frac12u - \frac14 \sin(2u)\right) + C_2 \\ &= \frac18\theta - \frac1{32} \sin(4\theta) + C_2 \end{align}

So we get that \begin{align} -224 \int \sin^4\theta\, d\theta &= -224\left(\frac12\theta - \frac14 \sin(2\theta) + C_1 - \left(\frac18\theta - \frac1{32} \sin(4\theta) + C_2 \right)\right)\\ &= -224\left(\frac38\theta - \frac14 \sin(2\theta) + \frac1{32} \sin(4\theta)\right) + C\\ &= -7\left(12\theta - 8\sin(2\theta) + \sin(4\theta)\right) + C\\ &= -7\left(12\theta - 16\sin\theta\cos\theta + 2\sin(2\theta)\cos(2\theta)\right) + C\\ &= -7\left(12\theta - 16\sin\theta\cos\theta + 4\sin\theta\cos\theta(1-2\sin^2\theta)\right) + C\\ &= -7\left(12\theta - 12\sin\theta\cos\theta - 8\sin^3\theta\cos\theta\right) + C\\ &= -7\left(12\theta - 12\sin\theta\cos\theta - 8\sin^3\theta\cos\theta\right) + C\\ &= -7\left(12\arcsin\left(\frac{\sqrt x}2\right) - 6\sqrt x \sqrt{1 - \frac x4} - x^{3/2}\sqrt{1 - \frac x4}\right) + C\\ &= -7\left(12\arcsin\left(\frac{\sqrt x}2\right) - 3\sqrt{4x - x^2} - \frac12 x\sqrt{4x - x^2}\right) + C\\ \end{align}

You might recognize that the terms here are similar to the terms in your proposed solution

$$14\left(\frac{\sqrt{4x-x^2}(x-2)}{2}-2\sqrt{4x-x^2}-3\arcsin\left(\frac{x-2}{2}\right)\right)+C,$$

especially if you realize that $$\arcsin\left(\frac{\sqrt x}{2}\right) = \frac12 \arcsin\left(\frac{x-2}{2}\right) + \frac\pi4,$$

but the coefficients do not match. The proof of the pudding is to take the derivative. (I did this for both solutions--and when I first did it on my calculations it showed me I had made an arithmetic error, which I was then able to find and correct to get the solution shown here now.)

By the way, I found this a tedious and error-prone approach. Other solutions offer better approaches. I was just curious to see how your original attempt would work out without mistakes.

• Thank you. I have an important conceptual question. Is that the correct substitution for dx because we are integrating wrt x only and differentiating for some power of x is a mistake? I posted the question elsewhere last night since this site was down for maintenance and there it was suggested that I should have put $$4cos\theta=\frac{1}{\sqrt{x}}dx$$ Is that also a legal sub for dx? – mtlchk Feb 16 '20 at 7:37
• Formally, you can express the relationship of $u$ to $x$ by any equation you want, but you have to take the differential of whatever is on both sides. So if you write $2\sin\theta = \sqrt x$ then you can write $2\cos\theta \,d\theta$ on the left but you can't just strip off the $\sqrt\$ and slap a $d$ onto the right, you actually have to differentiate $\sqrt x$ wrt $x.$ If you do that, you get $$2\cos\theta = \frac1{2\sqrt x} dx,$$ and if you multiply both sides by $2$ you get the suggested equation. – David K Feb 16 '20 at 12:40
• I squared both sides of your substitution to get $4\sin^2\theta=x$ and took the differentials of that, so I only had to work out the derivative of $4\sin^2\theta$; but note that if you multiply $$4\cos\theta = \frac1{\sqrt x} dx,$$ by $\sqrt x$ on both sides you get $$4{\sqrt x}\cos\theta = dx,$$ and then because you are making the substitution $\sqrt x = 2\sin\theta$ you get $$8\sin\theta\cos\theta = dx,$$ so you see it's really the same substitution, just arranged differently. – David K Feb 16 '20 at 12:45
• Yes, I was thinking about that after I wrote. Thank you. – mtlchk Feb 16 '20 at 19:35