I am not able to do the following integration.

\begin{equation}

\int_{0}^{a} x\sin^2 \left(\frac{n \pi x}{a} \right)dx

\end{equation}

It shows an error that “more input is needed”.

The mathematica code that I wrote is

```
R = Range[1, 10];
X = Integrate[x.[Sin[R.\[Pi].x/a]]^2, {x, 0, a}]
```