Confusion regarding Fourier half series for sine and cosine

I have been struggling with a problem for a long time. Solving a second order partial differential equation using Fourier half series in sine with the help of Mathematica gives me $$\phi_{mine}(x,y)=-\sum_{k=1,3,5,...}^{\infty}\frac{8 a^2 G_{zy} \theta \left(\text{sech}\left(\frac{\pi b k}{2 a} \frac{\sqrt{G_{zx}}}{\sqrt{G_{zy}}} \right) \cosh \left(\frac{\pi k y}{a} \frac{\sqrt{G_{zx}}}{\sqrt{G_{zy}}}\right)-1\right)}{\pi ^3 k^3}\sin \left(\frac{\pi k x}{a}\right)$$ where $$G_{zy}$$, $$G_{zx}$$, $$\theta$$, $$a$$, and $$b$$ are constants.

This is almost exactly what is written in the solution that I have, which is $$\phi_{sol}(x,y)=\frac{8}{\pi^3} G_{zy} a^2 \sum_{k=1,3,5,...}^{\infty}\frac{(-1)^{(k-1)/2}}{k^3}\left( 1-\frac{\cosh \left(\frac{\pi k \mu }{a}y\right)}{\cosh \left(\frac{b \pi k \mu}{2 a}\right)} \right)\cos \left(\frac{\pi k}{a}x\right)$$ where $$\mu=\sqrt{\frac{G_{zx}}{G_{zy}}}$$.

$$\phi_{sol}(x,y)$$ is missing $$\theta$$ but I suspect that it's a typo. I've been trying to figure out the difference between my answer and the solution and all I can find is that somehow $$\sin \left(\frac{\pi k x}{a}\right)=\cos\left(\frac{\pi k x}{a}\right) (-1)^{(k-1)/2}$$ for $$k=1,3,5,...$$ I've never seen this and when I plot them they give different curves so they don't seem to be equivalent.

As can be seen, $$a$$ determines the amplitude of the periodic functions so that $$\sin \left(\frac{\pi k x}{a}\right)$$ is always $$0$$ at -1 and 1. $$\cos\left(\frac{\pi k x}{a}\right) (-1)^{(k-1)/2}$$ on the other hand flips from $$1$$ to $$-1$$ at $$\pm a$$.

The next step in the process involves working out the constant $$\beta$$, $$\beta=\frac{2 \int_0^b \left(\int_0^a \phi (x,y) \, dx\right) \, dy}{G_{zx} a b^3}$$ I get that $$\phi_{sol}(x,y)$$ converges to a value while $$\phi_{mine}(x,y)$$ goes to infinity. Therefore I'm doing something wrong but I'm not sure what. Is it possible to change $$\sin \left(\frac{\pi k x}{a}\right)$$ into $$\cos\left(\frac{\pi k x}{a}\right) (-1)^{(k-1)/2}$$?

• No, that's wrong. I corrected it, thanks for pointing it out. – enea19 Apr 8 at 1:07