Fourier sine series. 
I am trying to find the Fourier sine series of the function $$f(x)=1-x,\quad 0<x<1.$$

My method is as follows:
We seek $\displaystyle f(x)=\sum_{j=1}^{N} A_j\phi_j(x)$, where$$A_j=\frac{2}{L}\int_{K}^{L} f(x)\sin\left(\frac{j\pi x}{L}\right) \,\mathrm{d}x, \quad (K,L)=(0,1).$$
Hence,
\begin{align}
A_j&=\frac{2}{j\pi}.
\end{align}
Furthermore, find the mean square error when the first $3$ terms of the above series are used. I believe the best way to do this is to use Parseval's identity.
The final part is the following. If each additional term $n$ is added and $n\rightarrow\infty$, can a point $0<a_n<1$ always be found such that the series $Sf$ differs from $f$ by more than $0.5$ (i.e. $|Sf(a_n)-f(a_n)|>0.5$).
 A: $\def\d{\mathrm{d}}\def\i{\mathrm{i}}\def\e{\mathrm{e}}\def\Im{\operatorname{Im}}\def\inprod#1#2{\left\langle#1,#2\right\rangle}\def\norm#1{\left\|#1\right\|}$For the first question, your method is indeed correct, although the Fourier coefficients can be also calculated by complex integration:\begin{gather*}
A_j = 2 \int_0^1 (1 - x) \sin(jπx) \,\d x = 2 \Im\left( \int_0^1 (1 - z) \e^{jπz\i} \,\d z \right),\\
\int_0^1 (1 - z) \e^{jπz\i} \,\d z = \left. \left( \frac{\i z}{jπ} - \frac{jπ\i + 1}{(jπ)^2} \right) \e^{jπz\i} \right|_0^1 = -\frac{\e^{jπ\i}}{(jπ)^2} + \frac{jπ\i + 1}{(jπ)^2},\\
A_j = 2 \Im\left( -\frac{\e^{jπ\i}}{(jπ)^2} + \frac{jπ\i + 1}{(jπ)^2} \right) = \frac{2}{jπ}.
\end{gather*}
If $f(x)$ is a polynomial of a higher degree, then complex integration method would be simpler since it avoids integration by parts.
For the second question, define$$
\inprod{g}{h} = \int_0^1 g(x) h(x) \,\d x, \quad \norm{g} = \sqrt{\smash[b]{\inprod{g}{g}}}. \quad \forall g,h \in L^2([0, 1])
$$
Because $f(x) = 1 - x \in L^2([0, 1])$, then by the orthogonality of $\{ϕ_j\}$ and Parseval's identity,\begin{align*}
&\mathrel{\phantom{=}}{} \norm{f - (A_1 ϕ_1 + A_2 ϕ_2 + A_3 ϕ_3)}^2\\
&= \norm{\sum_{j = 1}^∞ A_j ϕ_j - (A_1 ϕ_1 + A_2 ϕ_2 + A_3 ϕ_3)}^2 = \norm{\sum_{j = 4}^∞ A_j ϕ_j}^2\\
&= \sum_{j = 4}^∞ A_j^2 \norm{ϕ_j}^2 = \sum_{j = 1}^∞ A_j^2 \norm{ϕ_j}^2 - \frac{1}{2} (A_1^2 + A_2^2 + A_3^2)\\
&= \norm{f}^2 - \frac{1}{2} (A_1^2 + A_2^2 + A_3^2)\\
&= \int_0^1 (1 - x)^2 \,\d x - \frac{1}{2} \left( \frac{4}{π^2} + \frac{1}{π^2} + \frac{4}{9π^2} \right)\\
&= \frac{1}{3} - \frac{49}{18π^2},
\end{align*}
i.e.$$
\norm{f - (A_1 ϕ_1 + A_2 ϕ_2 + A_3 ϕ_3)} = \sqrt{\frac{1}{3} - \frac{49}{18π^2}}.
$$
For the third question, since for any $n \geqslant 1$,$$
\lim_{x → 0^+} (f_n(x) - f(x)) = \sum_{j = 1}^n \frac{2}{jπ} \lim_{x → 0^+} \sin(jπx) - \lim_{x → 0^+} (1 - x) = -1,
$$
and $f_n$ and $f$ are continuous at $x = 0$, then there exists $a_n \in (0, 1)$ such that $|(f_n(a_n) - f(a_n)) - (-1)| < 0.5$, which implies$$
|f_n(a_n) - f(a_n)| \geqslant |-1| - |(f_n(a_n) - f(a_n)) - (-1)| > 0.5.
$$
