Why can't I use integration by parts immediately here without using trigo identities? Basically the question is to integrate this:
$$ \int \cos x \cdot \cos 9x \space dx $$
I want to know if it is okay to do integration by parts immediately without simplifying it with trigonometric identities? If not, could you explain why?
The modal answer is:
$
\frac{1}{20}sin10x + \frac{1}{16}sin8x+C
$
But if I want to use by parts for example, I chose $u$ and $dv$ to be:
$$u=\cos x$$
$$dv=\cos 9x$$
update1 here is my attempted solution as requested but could not deduce the modal answer:

update2: there are solutions provided but it is not the same as the modal answer. Is it technically the same? Just that we have to play around with the identities to match the modal answer?
 A: I mean, you could, but where would that lead you?
$$u = \cos x, \quad du = -\sin x \, dx, \\ dv = \cos 9x \, dx, \quad v = \frac{1}{9}\sin 9x$$ yields
$$\int \cos x \cos 9x \, dx = \frac{1}{9} \cos x \sin 9 x + \frac{1}{9} \int \sin 9x \sin x \, dx. \tag{1}$$
The integral on the right hand side does not appear to be any easier to evaluate than the one we started with.
But maybe not all is lost:  note that $$\cos x \cos 9x - \sin x \sin 9x = \cos(9x + x) = \cos 10x \tag{2}$$ from the cosine angle addition identity $$\cos (\alpha + \beta) = \cos \alpha \cos \beta - \sin \alpha \sin \beta$$ with the choice $\alpha = 9x$, $\beta = x$.  Therefore, $$\int \cos 10x \, dx = \int \cos x \cos 9x - \sin x \sin 9x \, dx. \tag{3}$$  If we let $$I_1 = \int \cos x \cos 9x \, dx, \quad I_2 = \int \sin x \sin 9x \, dx,$$ then Equation $(1)$ becomes $$9I_1 = \cos x \sin 9x + I_2, \tag{4}$$ and Equation $(3)$ becomes $$I_1 - I_2 = \int \cos 10x \, dx = \frac{1}{10} \sin 10x + C.$$  Therefore, $$I_2 = I_1 - \frac{1}{10} \sin 10x + C \tag{5}$$
and substituting this into Equation $(4)$ gives
$$9I_1 = \cos x \sin 9x + I_1 - \frac{1}{10} \sin 10 x + C.$$  Now solve for $I_1$:
$$I_1 = \frac{1}{8} \left(\cos x \sin 9x - \frac{1}{10} \sin 10x\right) + C.$$
Of course, the whole thing could have been done more easily if we had applied a different trigonometric identity in the first place:
$$\cos \alpha \cos \beta = \frac{\cos(\alpha + \beta) + \cos(\alpha - \beta)}{2}. \tag{6}$$
This identity follows directly from the cosine angle addition identity, and for the same choice of $\alpha$ and $\beta$, we get
$$\cos x \cos 9x = \frac{1}{2}(\cos 10x + \cos 8x),$$ the integral of which is trivial.
A: Integrate the first term and differentiate the second twice to get a nontrivial relation for the integral:
$$I=\int\cos x\cos9x\,dx=\sin x\cos9x-(-9)\int\sin x\sin9x\,dx$$
$$=\sin x\cos9x+9\left(-\cos x\sin9x-(-9)\int\cos x\cos9x\,dx\right)$$
$$I=\sin x\cos9x-9\cos x\sin9x+81I$$
$$I=\frac1{80}(-\sin x\cos9x+9\cos x\sin9x)+K$$
So yes, it does work, but you have to put in a proportionate amount of work.
A: Here is what the book has probably done.
Consider $I_1 = \int (\cos x)(\cos 9x) \ dx, I_2 = \int (\sin x)(\sin 9x) \ dx$. $I_1 + I_2 = \int \cos(x - 9x) = \frac{1}{8} \sin(8x) + C_1$ and $I_1 - I_2 = \int \cos(x + 9x) = \frac{1}{10} \sin(10x) + C_2$.
Summing these up, $2I_1 = \frac{1}{8} \sin(8x) + \frac{1}{10} \sin(10x) + C$ which gives the stated answer.
