Integral of $\int_0^b \cos(x)\cos(\frac a x)dx$

I've tried integration by parts. I can integrate both factors:

$$\int\cos(x)dx = \sin(x) + C_1$$

$$\int\cos(\frac a x) = a Si(\frac a x) + x \cos(\frac a x) + C_2$$

However I'm stuck at this point. I think the way to proceed would be integration by parts, however that requires calculating the integral of $$\int (u' \int v dx) dx$$. However, I don't think there will be a nice closed form solution, no matter how many times I apply integration by parts, because I'll never be able to escape from $$u$$ being or containing $$f(x)$$, where $$f$$ is a periodic function, and $$v$$ being or containing $$g(\frac a x)$$, where $$g$$ is also a periodic function.

There's also some interesting ideas in Closed form of $\int_0^\infty \sin(x)\sin\left(\frac{1}{x}\right)dx$?, however I'm not sure how to adapt that solution to integrate from $$0$$ to $$b$$ instead of $$0$$ to $$\infty$$.

• WolframAlpha was unable to find a closed-form solution – Victoria M Feb 18 at 19:52
• Perhaps this integral won't even be decent at all. Here is maybe something similarly: math.stackexchange.com/q/3068201/515527 – Zacky Feb 18 at 23:19
• I doubt you will find a closed form solution, but have you looked at $\cos(x)\cos\left(\frac a x\right)=\frac{1}{2}\cos\left(x+\frac{a}{x}\right)+\frac{1}{2}\cos\left(x-\frac{a}{x}\right)$? – John Wayland Bales Feb 20 at 22:36
• @JohnWaylandBales I have looked into that. Unfortunately I'm not able to get much further with it. – Joel Feb 21 at 0:39