Apparently, the following appeared in Ramanujan's first letter to GH Hardy.
If $$\psi(p,n)=\int_0^a\phi(p,x)\cos(nx)dx,$$ then $$\frac{\pi}{2}\int_0^a\phi(p,x)\phi(q,nx)dx=\int_0^\infty \psi(q,x)\psi(p,nx)dx$$
I tried proving this, but with not much success. First, I wrote $$\psi(q,x)\psi(p,nx)=\int_0^a\int_0^a\phi(q,u)\phi(p,v)\cos(xu)\cos(nxv)dudv$$ Then I guess we have $$\int_0^\infty\psi(q,x)\psi(p,nx)dx=\int_0^\infty\int_0^a\int_0^a\phi(q,u)\phi(p,v)\cos(xu)\cos(nxv)dudvdx,$$ but this looks just awful. It's hard to believe that expression would somehow reduce to the desired one. If there is a way to go about it like this perhaps it is via some clever substitution or change of variables, but seeing as so little is known about $\phi$, I don't imagine there'd be much to work with.
Does anyone know how to prove Ramanujan's result?