MethodMath
Mike Johnson
May 8, 2026

I asked chatgpt to solve this integral and it gave a wrong answer can you do it correctly

I asked ChatGPT to integrate:

sin3xcos2xdx\int \frac{\sin^3 x}{\cos^2 x} \, dx

And it gave me:

sin3xcos2xdx=lnsecx+tanxsinx+C\int \frac{\sin^3 x}{\cos^2 x} \, dx = \ln|\sec x + \tan x| - \sin x + C

But when I differentiate this, I dont get the original integrand! I think the AI messed up.

Can a human solve this step by step so I can see the correct approach?

I tried rewriting sin3x=sinx(1cos2x)\sin^3 x = \sin x (1 - \cos^2 x) so:

sinx(1cos2x)cos2xdx=sinxcos2xdxsinxdx\int \frac{\sin x (1 - \cos^2 x)}{\cos^2 x} \, dx = \int \frac{\sin x}{\cos^2 x} \, dx - \int \sin x \, dx

Then u=cosxu = \cos x, du=sinxdxdu = -\sin x \, dx:

duu2+cosx=1u+cosx+C=secx+cosx+C-\int \frac{du}{u^2} + \cos x = \frac{1}{u} + \cos x + C = \sec x + \cos x + C

But this doesnt match the AIs answer either. Which one is correct?

1 answers804 views

Login to comment

1 Answer

Prof. Chen Wei
Prof. Chen WeiMay 8, 2026 Accepted
Theres a fundamental difference between these two integrals. For $\int \frac{\sin^3 x}{\cos^2 x} dx$, your approach is almost correct. Let me complete it: Rewrite $\sin^3 x = \sin x (1 - \cos^2 x)$: $$\int \frac{\sin x (1 - \cos^2 x)}{\cos^2 x} dx = \int \frac{\sin x}{\cos^2 x} dx - \int \sin x dx$$ Let $u = \cos x$, $du = -\sin x\,dx$: $$-\int \frac{du}{u^2} + \cos x = \frac{1}{u} + \cos x + C = \sec x + \cos x + C$$ Lets verify by differentiating: $$\frac{d}{dx}(\sec x + \cos x) = \sec x \tan x - \sin x$$ $$= \frac{\sin x}{\cos^2 x} - \sin x = \frac{\sin x - \sin x \cos^2 x}{\cos^2 x} = \frac{\sin x(1 - \cos^2 x)}{\cos^2 x} = \frac{\sin^3 x}{\cos^2 x}$$ So YOUR answer $\sec x + \cos x + C$ is correct. The AI was wrong. Trust your math, not the chatbot.

Login to comment

Login or Register to post an answer