Suppose I have a linear PDE of the form $u_{y} + u_{x} = x^2$.
Suppose also that the solution is of the form $u(x,y) = f_0(x) + \Sigma_{n=1}^{\infty} \alpha_{n}(y) \cos nx + \beta_{n}(y) \sin nx$.
The book I am reading suggests that I may write this as,
$f'_0(x) = x^2$,
$\alpha_{n}'(y) \cos nx - n \alpha_{n}(y) \sin nx = 0$,
$\beta_{n}'(y) \sin nx + n \beta_{n}(y) \cos nx = 0$.
Why is this allowed?
If the solution is on the form : $$u(x,y) = f_0(x) + \Sigma_{n=1}^{\infty} \left(\alpha_{n}(y) \cos nx + \beta_{n}(y) \sin nx\right)$$
$u_x = f'_0(x) + \Sigma_{n=1}^{\infty} \left(-n\alpha_{n}(y) \sin nx + n\beta_{n}(y) \cos nx\right)$.
$u_y = \Sigma_{n=1}^{\infty} \left(\alpha'_{n}(y) \cos nx + \beta'_{n}(y) \sin nx\right)$
$$u_{y} + u_{x} = x^2 = f'_0(x) + \Sigma_{n=1}^{\infty} \left( -n\alpha_{n}(y) \sin nx + n\beta_{n}(y) \cos nx\right) + \Sigma_{n=1}^{\infty} \left(\alpha'_{n}(y) \cos nx + \beta'_{n}(y) \sin nx\right)$$
To be valid for any $x$ and $y$, it implies : $$\begin{cases} \quad f'_0(x) = x^2\\ -n\alpha_{n}(y)+ \beta'_{n}(y)=0\\ n\beta_{n}(y)+\alpha'_{n}(y)=0 \end{cases}$$ from which $\alpha_n(y)$ and $\beta_n(y)$ can be derived.
I have not enough information about the textbook and context to more comment.
Note :
Another way for solving $\quad u_x+u_y=x^2\quad$ is the method of characteristics.
The general solution is : $$u(x,y)=\frac13 x^3+F(y-x)$$ where $F$ is any differentiable function.
This is consistent with the above form where $f_0(x)=\frac13 x^3\quad,\quad f'_0(x)=x^2$.
$F(y-x)$ can be presented on the form of Fourier series as the above sinusoidal functions.