I'm trying to solve the following pde
$u_{xx}+u_{yy}=\sin(x)-\sin^3(x)$
where $x\in(0,\frac{\pi}{2}),y\in(0,2)$ with the conditions
$u(0,y)=u_{x}(\frac{\pi}{2},y)=u_{y}(x,0)=u_{y}(x,2)=0$.
I've tried solving through separation of variables but I get confused since the PDE is non-homogeneous. I also got advice that I should use Fourier transform. If anyone could help I would be grateful.
Seek a solution of the form
$$u(x,y)=\sum_{\lambda}X_{\lambda}(x)Y_{\lambda}(y)$$
where $X$ satisfies the following ODE and boundary conditions
$$X''(x)+\lambda X=0$$
$$X(0)=X\left(\frac{\pi}{2}\right)=0$$
Since we have Dirichlet boundary conditions for $X$, we know that $\lambda > 0$ and we have
$$X_{\lambda}(x)=\sin(\lambda^{\frac{1}{2}}x)$$
$$\lambda^{\frac{1}{2}}=2n, n \in \mathbb{N}$$
Substituting $u$ into the PDE gives
$$\sum_{n=1}^{\infty}\left \{ \sin\left( 2nx \right) \left[ Y''(y)-4n^2Y(y)\right] \right \}=\sin(x)-\sin^3(x)$$
By orthogonality,
$$Y''(y)-4n^2Y(y)=\frac{\left<\sin\left( 2nx \right), \sin(x)-\sin^3(x)\right>}{\left<\sin\left( 2nx \right), \sin\left( 2nx \right) \right>} = \frac{4}{\pi}\int_{0}^{\frac{\pi}{2}}\sin(2nx)\sin(x)-\sin(2nx)\sin^3(x)dx$$
$$=\frac{16n(-1)^n}{\pi(2n-3)(2n-1)(2n+3)(2n+1)}$$
Let $G(y,\xi)$ be the Green function for this ODE satisfying $G(0,\xi)=G(2,\xi)=0$. Then,
$$Y(y)=\frac{16n(-1)^n}{\pi(2n-3)(2n-1)(2n+3)(2n+1)} \int_{0}^{2}G(y,\xi)d\xi$$
So the solution to the BVP is
$$u(x,y)=\sum_{n=1}^{\infty}\left \{\frac{16n(-1)^n\sin(2nx)}{\pi(2n-3)(2n-1)(2n+3)(2n+1)} \int_{0}^{2}G(y,\xi)d\xi \right \}$$