I do not use the Wolfram Language at Wolfram Alpha since the syntax is a little different and I have access to Wolfram Mathematica which I prefer to Wolfram Alpha.
If you have Wolfram Mathematica, then you use one of the Wolfram language commands, called FourierCoefficient
to generate $a_n$ and $b_n$ as follows. (You can try these commands at Wolfram Alpha, but I do not know if they will work as is)
ClearAll[f, x, n];
T0 = 2 Pi; (*period*)
f[x_] := Piecewise[{{1, -Pi < x <= 0}, {Sin[x], 0 <= x <= Pi}}]
Plot[f[x], {x, -T0/2, T0/2}, Exclusions -> None]
nTerms = 10;
c = Table[FourierCoefficient[f[x], x, n, FourierParameters -> {1, 1}], {n, 0,
nTerms}];
b = Table[I*(c[[n]] - Conjugate@c[[n]]), {n, 2, nTerms}];
a = Table[(c[[n]] + Conjugate@c[[n]]), {n, 2, nTerms}];
Grid[{{Grid[Join[{{"n", "a(n)"}}, Table[{n, a[[n]]}, {n, 1, Length@a}]],
Frame -> All],
Grid[Join[{{"n", "b(n)"}}, Table[{n, b[[n]]}, {n, 1, Length@a}]],
Frame -> All]}}]
And now you can plot the Fourier Series approximation
fapprox[x_] := (c[[1]] + Sum[a[[n]] Cos[n x], {n, 1, Length@a}] +
Sum[b[[n]] Sin[n x], {n, 1, Length@b}])
Plot[{f[x], fapprox[x]}, {x, -T0/2, T0/2}, Evaluated -> True,PlotRange -> All]
By adding more terms, the approximation will improve. This is for 30 terms:
The above uses the standard conversion from complex fourier coefficients to the non-complex ones given by
$$
\begin{align}
a_0 &= c_0\\
b_n &= i(c_n - c_n^\ast)\\
a_n &= c_n + c_n^\ast
\end{align}
$$
In above, $c_n^\ast$ is complex conjugate.
The command FourierCoefficient
generates $c_n$ and the above converts them standard $a_n,b_n$.
If you prefer to do this by hand, then you can use the definitions of $a_n$ and $b_n$
T0 = 2 Pi;
f[x_] := Piecewise[{{1, -Pi < x <= 0}, {Sin[x], 0 <= x <= Pi}}]
a0 = 1/(T0/2) Integrate[f[x], {x, -T0/2, T0/2}]
an = 1/(T0/2) Integrate[f[x] Cos[n x], {x, -T0/2, T0/2}];
an = Assuming[n > 0 && Element[n, Integers], Simplify[an]]
bn = 1/(T0/2) Integrate[f[x] Sin[n x], {x, -T0/2, T0/2}]
etc...
But it is better to use the FourierCoefficient
command to eliminate making mistakes.
Comment asked to show $b_1$ by hand to verify Mathematica is correct.
$$\begin{align*}
b_{n} & =\frac{1}{\pi}\int_{-\pi}^{\pi}f\left( x\right) \sin\left(
nx\right) dx\\
& =\frac{1}{\pi}\left( \int_{-\pi}^{0}\sin\left( nx\right) dx+\int_{0}%
^{\pi}\sin\left( x\right) \sin\left( nx\right) dx\right) \\
& =\frac{1}{\pi}\left( I_{1}+I_{2}\right)
\end{align*}
$$
Let us do $I_{1}$ first
$$\begin{align*}
\int_{-\pi}^{0}\sin\left( nx\right) dx & =\frac{-1}{n}\left[ \cos\left(
nx\right) \right] _{-\pi}^{0}\\
& =\frac{-1}{n}\left[ \cos\left( 0\right) -\cos\left( -n\pi\right)
\right] \\
& =\frac{-1}{n}\left[ 1-\cos\left( n\pi\right) \right] \\
& =\frac{\cos\left( n\pi\right) -1}{n}\\
& =\frac{-1^{n}-1}{n}
\end{align*}
$$
Now we do $I_{2}=\int_{0}^{\pi}\sin\left( x\right) \sin\left( nx\right)
dx$. Using $\sin u\sin v=\frac{1}{2}\left( \cos\left( u-v\right)
-\cos\left( u+v\right) \right) $ the integrand becomes
$$
\begin{align*}
I_{2} & =\frac{1}{2}\int_{0}^{\pi}\cos\left( x-nx\right) -\cos\left(
x+nx\right) dx\\
& =\frac{1}{2}\left( \int_{0}^{\pi}\cos\left( \left( 1-n\right) x\right)
dx-\int_{0}^{\pi}\cos\left( \left( 1+n\right) x\right) dx\right) \\
& =\frac{1}{2}\left( \frac{\sin\left( \left( 1-n\right) x\right)
}{\left( 1-n\right) }-\frac{\sin\left( \left( n+1\right) x\right) }
{n+1}\right) _{0}^{\pi}\\
& =\frac{1}{2}\left( \frac{\sin\left( \left( n-1\right) \pi\right) }
{n-1}-\frac{\sin\left( \left( n+1\right) \pi\right) }{n+1}\right)
\end{align*}
$$
Hence
$$
\begin{align*}
b_{n} & =\frac{1}{\pi}\left( I_{1}+I_{2}\right) \\
& =\frac{1}{\pi}\left( \frac{-1^{n}-1}{n}+\frac{1}{2}\left( \frac
{\sin\left( \left( n-1\right) \pi\right) }{n-1}-\frac{\sin\left( \left(
n+1\right) \pi\right) }{n+1}\right) \right)
\end{align*}
$$
For integer $n\geq1$, the term $\frac{\sin\left( \left( n+1\right)
\pi\right) }{n+1}$ always zero, therefore
$$
b_{n}=\frac{1}{\pi}\left( \frac{-1^{n}-1}{n}+\frac{1}{2}\left( \frac
{\sin\left( \left( n-1\right) \pi\right) }{n-1}\right) \right)
$$
For $n=1$, and since denominator becomes zero at $n=1$, must take the limit
$$
\begin{align*}
b_{1} & =\frac{1}{\pi}\left( \frac{-2}{1}+\frac{1}{2}\left( \lim
_{n\rightarrow1}\frac{\sin\left( \left( n-1\right) \pi\right) }
{n-1}\right) \right)
\end{align*}
$$
Using L'Hopital
$$
\lim_{n\rightarrow1}\frac{\sin\left( \left( n-1\right) \pi\right) }
{n-1}=\lim_{n\rightarrow1}\frac{\frac{d}{dn}\sin\left( \left( n-1\right)
\pi\right) }{\frac{d}{dn}\left( n-1\right) }=\lim_{n\rightarrow1}\frac
{\pi\cos\left( \left( n-1\right) \pi\right) }{1}=\frac{\pi\cos\left(
0\right) }{1}=\pi
$$
Hence
$$
\begin{align*}
b_{1} & =\frac{1}{\pi}\left( -2+\frac{1}{2}\pi\right) \\
& =\frac{1}{\pi}\left( \frac{-4+\pi}{2}\right) \\
& =\left( \frac{-4+\pi}{2\pi}\right)
\end{align*}
$$
Which is the result given by Mathematica above.
For $n>1$ we see that $b_{n}$ simpifies to
$$
\frac{1}{\pi}\left( \frac{-1^{n}-1}{n}\right)
$$
Since the second term is zero. Hence for $n=2$, $b_{2}=0$ and for $n=3$,
$b_{3}=\frac{1}{\pi}\left( \frac{-1^{3}-1}{3}\right) =\frac{1}{\pi}\left(
\frac{-2}{3}\right) $ and so on....
=
$\endgroup$