Final Answer
Step-by-step Solution
Specify the solving method
Apply the trigonometric identity: $\cos\left(\theta \right)^2$$=\frac{1+\cos\left(2\theta \right)}{2}$
We can solve the integral $\int x\frac{1+\cos\left(2x\right)}{2}dx$ by applying integration by parts method to calculate the integral of the product of two functions, using the following formula
First, identify $u$ and calculate $du$
Now, identify $dv$ and calculate $v$
Solve the integral
Take the constant $\frac{1}{2}$ out of the integral
The integral of a constant is equal to the constant times the integral's variable
Apply the formula: $\int\cos\left(ax\right)dx$$=\frac{1}{a}\sin\left(ax\right)+C$, where $a=2$
Now replace the values of $u$, $du$ and $v$ in the last formula
Multiply the single term $x$ by each term of the polynomial $\left(\frac{1}{2}x+\frac{1}{4}\sin\left(2x\right)\right)$
We can solve the integral $\int\sin\left(2x\right)dx$ by applying integration by substitution method (also called U-Substitution). First, we must identify a section within the integral with a new variable (let's call it $u$), which when substituted makes the integral easier. We see that $2x$ it's a good candidate for substitution. Let's define a variable $u$ and assign it to the choosen part
Now, in order to rewrite $dx$ in terms of $du$, we need to find the derivative of $u$. We need to calculate $du$, we can do that by deriving the equation above
Isolate $dx$ in the previous equation
Substituting $u$ and $dx$ in the integral and simplify
The integral $-\frac{1}{2}\int xdx-\frac{1}{4}\int\frac{\sin\left(u\right)}{2}du$ results in: $-\frac{1}{4}x^2+\frac{1}{8}\cos\left(2x\right)$
Gather the results of all integrals
Combining like terms $\frac{1}{2}x^2$ and $-\frac{1}{4}x^2$
As the integral that we are solving is an indefinite integral, when we finish integrating we must add the constant of integration $C$