# Integrate (numerically) $\int_0^{2\pi} \sin^x(x) \, dx$ [closed]

How can we calculate the integration $\int_0^{2\pi} \sin^x(x) \, dx$ numerically?

I tried calculating it using Simpson's rule and trapezoidal rule using python program; but it gave 'nan'.

Mathematica's NInregrate[(Sin[x])^x,{x,0,2 Pi}] gives 1.77788+ i 0.364092.

What would be the approach to solve this?

(I am quite puzzled, why does this have an imaginary solution? This part is solved)

## closed as off-topic by Jack D'AurizioOct 20 '17 at 13:27

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Jack D'Aurizio
If this question can be reworded to fit the rules in the help center, please edit the question.

• Between $\pi$ and $2 \pi$, the equation $\sin^x(x)$ is not defined, as $\sin(x) \lt 0$, and $a^x, a \lt 0$ is not defined for all numbers, only integers:desmos.com/calculator/gpbagrwj7d – John Lou Oct 20 '17 at 3:28

The integral cannot be computed over reals as there are many points of discontinuity for $\pi<x< 2\pi$.
Eg. For $\pi<x<2\pi$, $\sin(x)$ is negative. Say $x = \pi + \frac{\pi}{6} = \frac{7\pi}{6}$. Then your function is of the form $$\sin\left(\frac{7\pi}{6}\right) ^{\frac{7\pi}{6}} = \left(\frac{-1}{2}\right)^{\frac{7\pi}{6}}$$
The problem lies with the fact that $(f(x))^{x}$ is not well defined when $f(x) < 0$ because of many points of discontinuity.
Alternatively, you can easily calculate the integral for $x\in (0,\pi)$ and we would not have this problem.
• I mean $f(z) = \Re(f(z)) + i \Im(f(z))$ – samjoe Oct 20 '17 at 6:17