Q:

To Solve a PDE by direct integration

$\displaystyle \frac{\partial^2 z}{\partial x^2}=a^2z $, given that when $\displaystyle x=0, \frac{\partial z}{\partial x}=a\sin y$ and $\displaystyle \frac{\partial z}{\partial y}=0 $
The solution is given as $\displaystyle z=\sin x+ e^y\cos x$. This does not even satisfy the main equation.  
I tried with $\displaystyle z=f(y)\sinh x+ g(y)\cosh x$. This seems to work, but I am not sure if I am right.  
Please advise. 

A:

You can treat the equation $\frac{\partial^2z}{\partial x^2}=a^2z$ like ODE, but constants can depend on $y$, so $u(x)=z$ and we have $u''=a^2u$, the solution of this ODE is $u=Ce^{ax}+De^{-ax}$, but $C,D$ can depend on $y$, so 
$z(x,y)=C(y)e^{ax}+D(y)e^{-ax}$
Next we can use conditions when $x=0$:
$\frac{\partial z}{\partial x}=aC(y)e^{ax}-aD(y)e^{-ax}$
$\frac{\partial z}{\partial y}=C'(y)e^{ax}+D'(y)e^{-ax}$
Thus for $x=0$ we have:
$a(C(y)-D(y))=a\sin y$
$C'(y)+D'(y)=0$
From first we have:
$C'(y)-D'(y)=\cos y$, next adding second:
$2C'(y)=\cos y$, so:
$C(y)=\frac{\sin y}{2} + C_1$ and
$D(y)=-\frac{\sin y}{2} + C_1$, where $C_1$ is a constant.