This question is from section 5.6 of Partial Differential Equations: An Introduction 2nd Edition by Walter Strauss 2008. I have approached this question by using the separation of variables $u(x,t) = X(x)T(t)$
This leads to solving 2 ODEs which are $$X''=-\lambda X$$ and $$T' = -\lambda T$$ after applying boundary conditions we get $$X_n(x) = \cos ( (n + 1/2)\pi x ), \ \ \ \ T_n(t) = e^{ (n + 1/2)^2 \pi^2 t}$$
I assume I have to compute the Fourier coefficients $$A_n = \{x^2, \cos ( (n + 1/2)\pi x )\}$$
My answer does not match with the book's answer which is $$A_n = (-1)^{(n+1)} \cdot 4 \cdot ((n + 1/2)\pi)^{-3}$$
The full series from the answers is $$1 + \sum_{n=0}^\infty A_n \cos ( (n + 1/2)\pi x ) e^{ -(n + 1/2)^2 \pi^2 t}$$
Can someone advise how I can proceed? Or if there is a flaw in my method then please correct me.
The related section in the textbook does not explain how to handle mixed boundary conditions. In this question, only one boundary condition $$u(1,t) = 1$$ is given while the other condition is a Neumann condition. What confuses me the most is how to handle these questions where you are given mixed boundary conditions.