4

I wanted to integrate $\int\frac{\sin^4(x)}{\cos(x)}dx$, using “Mathway” and it yielded $\frac{1}{5}\sin^5(x)+C$ by substituting $u=\sin(x)$, My problem is when I do it

$u = \sin(x)dx$

$du = \cos(x)dx$

$\frac{du}{\cos(x)} = dx$

I get,

$\int\frac{u^4}{\cos(x)*\cos(x)}du=\int\frac{u^4}{\cos^2(x)}du$

Instead of

$\int{u^4}du$ which was Mathway's output, Did I do something wrong?

enter image description here

enter image description here

pie
  • 4,192
  • Simply plot $\frac{1}{5}\sin^5 x$ and $\frac{\sin^4 x}{\cos x}$, and you will immediately see that the latter cannot possibly be the derivative of the former. For instance, $\frac{1}{5}\sin^5 x$ is smooth, but $\frac{\sin^4 x}{\cos x}$ has a singularity at $x = \pm \frac{\pi}{2}$. – Nate Eldredge Nov 23 '23 at 00:18

2 Answers2

8

I don't know what "Mathway" is, but whatever it's doing, it's hallucinating, because you are absolutely correct. If $u = \sin x$, then $du = \cos x \, dx$, which does not work: $$\int \frac{\sin^4 x}{\cos x} \, dx = \int \frac{u^4}{\cos^2 x} \, du.$$ The $\cos x$ in the denominator does not cancel out.

Another way to see that the claimed solution cannot be correct is to simply differentiate the answer:

$$\frac{d}{dx}\left[\frac{1}{5} \sin^5 x \right] = \sin^4 x \cos x,$$

and this is not equivalent to the given integrand.


A correct method of solution would be to write $$\frac{\sin^4 x}{\cos x} = \frac{\sin^4 x \cos x}{\cos^2 x} = \frac{\sin^4 x \cos x}{1 - \sin^2 x},$$ and now let $$u = \sin x, \quad du = \cos x \, dx,$$ to obtain $$I = \int \frac{\sin^4 x}{\cos x} \, dx = \int \frac{u^4}{1-u^2} \, du.$$ Now perform long division and partial fraction decomposition: $$\frac{u^4}{1-u^2} = -u^2 - 1 + \frac{1}{1-u^2} = -u^2 - 1 + \frac{1}{2(1-u)} + \frac{1}{2(1+u)},$$ so $$\begin{align} I &= \int -u^2 - 1 \, du + \frac{1}{2}\int \frac{1}{1-u} + \frac{1}{1+u} \, du \\ &= -\frac{u^3}{3} - u + \frac{1}{2} \left( \log|1+u| - \log|1-u| \right) + C \\ &= -\frac{\sin^3 x}{3} - \sin x + \frac{1}{2} \log \left|\frac{1+\sin x}{1-\sin x}\right| + C. \end{align}$$ Differentiation of this expression will confirm its derivative is equal to the given integrand.

heropup
  • 135,869
  • I thought that I had a nightmare ! – Claude Leibovici Nov 22 '23 at 07:55
  • 2
    This is what Google says about MathWay:"Mathway is a fantastic resource for students who need help with their arithmetic assignments because it uses artificial intelligence.". My experience with artificial intelligence (shortly A.I.) on mathematics is ChatGPT, which has told me that $2^5=3 \times 3 \times 3 \times 3 \times 3=243$. After this experience, never again will I use A.I.-based tools for mathematical purposes :-) – Dominique Nov 22 '23 at 15:56
  • 1
    @Dominique it's using extremely large values of $2$ – Vandermonde Nov 22 '23 at 17:28
  • @Dominique That quote is not from google. It's from the link google search found. The same linked page further down says Maple and Wolfram Alpha and Sage and Sympy and Geogebra and Desmos are also "powered by AI". – Ethan Bolker Nov 22 '23 at 20:15
6

This seems to be fully wrong

$$I=\int\frac{\sin^4(x)}{\cos(x)}dx$$

$$u=\sin(x) \implies x=\sin^{-1}(u) \implies dx=\frac{du}{\sqrt{1-u^2}}$$

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