solve the integral Could anyone help me on how to go about this integral.
Calculate:  $$\int_0^{\pi/6}\left(\sin2x-\frac{\cos 3x}{3}+\frac{x^2}{2}\right)dx$$
This is how I've done and not coming up with right answer:
I get a primitive function
$$\left[-\frac{\cos 2x}{2}-\frac{1}{3}\frac{\sin3x}{3}+\frac{x^3}{6}\right]_0^{\frac{\pi}{6}}$$
and then I go ahead substituting in the respective $\pi/6$ och 0 boundary values which lead to $$\frac{1}{4}-\frac{1}{9\sqrt{2}}+\frac{\pi^3}{216*6}$$ and it's a wrong answer.
Any suggestions are highly appreciated!

Your primitive function is good but there are a few issues in the calculations afterwards:


*

*you missed a minus-sign (the first term is $\mathbf{\color{red}{-}}1/4$);

*you probably simplified the part of $\sin(3x)$ in $x=\pi/6$ in the wrong way: no square roots come out of that, but rather $\sin(\pi/2) = 1$;

*you missed a contribution from the lower limit $x=0$ ($\cos$ is $1$ there, not $0$).


Careful computation yields:
$$\begin{array}{rl}
\displaystyle \int_0^{\pi/6} \sin(2x)-\frac{\cos(3x)}{3}+\frac{x^2}{2} \, dx 
&\displaystyle = \left[ -\frac{\cos(2x)}{2}-\frac{\sin(3x)}{9} + \frac{x^3}{6}\right]_0^{\pi/6} \\[5pt]
&\displaystyle = \left( -\frac{\cos(\tfrac{\pi}{3})}{2}-\frac{\sin(\tfrac{\pi}{2})}{9} + \frac{\left( \tfrac{\pi}{6} \right)^3}{6}\right)-\left( -\frac{1}{2}-0+0\right) \\[5pt]
&\displaystyle = \left( -\frac{1/2}{2}-\frac{1}{9} + \frac{\left( \tfrac{\pi}{6} \right)^3}{6}\right)-\left( -\frac{1}{2}-0+0\right) \\[5pt]
&\displaystyle = \frac{5}{36}+\frac{\pi^3}{6^4}= \frac{5}{36}+\frac{\pi^3}{1296}
\end{array}$$
