Calculate $f (0)$ with $f ''(x)$ continuous We know that:
$1)\,\int_{0}^{\pi} [f(x) +f''(x)]\sin(x)\,dx = 2$
$2)\:f(\pi) = 1$
$3)\: f''(x)$ is continuous
Calculate  $f (0)$
I did the following:
$\int_{0}^{\pi} [f(x) +f''(x)]\sin(x)\,dx = \int_{0}^{\pi} f(x)\sin(x)\,dx + \int_{0}^{\pi} f''(x)\sin(x)\,dx=  $
Let
(a) = $\int_{0}^{\pi} f(x)\sin(x)\,dx$
(b) = $\int_{0}^{\pi} f''(x)\sin(x)\,dx$
Using integration by parts
In (a) $u=f(x)$  and  $dv=\sin(x)\,dx$
In (b) $u=\sin(x)$  and  $dv=f''(x)\,dx$
$\int_{0}^{\pi} [f(x) +f''(x)]\sin(x)\,dx = 1+f(0)+\int_{0}^{\pi} f'(x)\cos(x)\,dx -\int_{0}^{\pi} f'(x)\cos(x)\,dx$
$\Rightarrow 2= 1+f(0)+\int_{0}^{\pi} f'(x)\cos(x)\,dx -\int_{0}^{\pi} f\prime(x)cos(x)dx$
$\Rightarrow 2= 1+f(0)$
$\Rightarrow 1=f(0)$
$$\therefore f(0)=1$$
Is it correct?
 A: Your final answer is correct, but I didn't go through the calculation.
Here's a different (fancier) method that arrives at the same conclusion:
Write the Fourier series of $f$ as
\begin{align}
f(x) \sim a_0 + a_1 \sin(x)+a_2 \sin(2x)+\ldots 
\end{align}
then we see that
\begin{align}
&\int^\pi_0 [f(x)+f''(x)]\sin(x)\ dx \\
&=\int^\pi_0 [a_0+a_1\sin(x)+a_2\sin(2x)+\ldots]\sin(x)\ dx\\
&\quad\ +\int^\pi_0 [-a_1\sin(x)-4a_2\sin(2x)-\ldots]\sin(x)\ dx = 2 a_0.
\end{align}
Since $f$ is twice continuously-differentiable on $[0, \pi]$ then $f$ extends to a piecewise differentiable periodic function on $\mathbb{R}$. In particular, we see that the Fourier series of $f$ converges pointwise everywhere on $\mathbb{R}$ to $f(x)$ if $f$ is continuous at $x$ or $\frac{1}{2}(f(x+)+f(x-))$, i.e. the left and right limit of $f$ at $x$. Hence we have that
\begin{align}
f(x) = \frac{f(0)+f(\pi)}{2}+a_1 \sin(x)+a_2 \sin(2x)+\ldots 
\end{align}
This shows that
\begin{align}
2=\int^\pi_0 [f(x)+f''(x)]\sin(x)\ dx= 2 a_0 = 2\frac{f(0)+f(\pi)}{2}.
\end{align}
Solving for $f(0)$ yields
\begin{align}
f(0) = 2-f(\pi) = 1.
\end{align}
A: I compute the second integral using integration by parts:
\begin{align*}
\int_0^{\pi}f''(x)\sin x\, dx & = \int_0^{\pi} \sin x\, df'(x) \\
& = - \int_0^{\pi}f'(x)\cos x \,dx \\
& = - \int_0^{\pi} \cos x\, df(x) \\
& = -f(x)\cos x \rvert_0^{\pi}-\int_0^{\pi}f(x)\sin x\, dx \\
& = f(\pi)+f(0)-\int_0^{\pi}f(x)\sin x\, dx.
\end{align*}
Therefore
\begin{align*}
\int_0^{\pi} (f(x)+f''(x))\sin x\, dx = 1+f(0)=2 \Rightarrow f(0)=1.
\end{align*}
So yes, your answer is correct.
