Hint: Try to substituted $3y=t$ first and then use the second of the following fact:
Theorem: The integral
$$\int x^m(a+bx^n)^pdx$$
can be reduced if $m,n,p$ are rational numbers, to the integral of a rational function, and can thus be expressed in terms of elementary functions if:
$1.$ $p$ is an integer( $p>0$ use the Newton's binomial theorem and when $p<0$ then $x=t^k$ which $\text{lcm}(n,m)$).
$2.$ $\dfrac{m+1}{n}$ is an integer. So set $a+bx^n=t^{\alpha}$ wherein $\alpha$ is the denominator of $p$.
$3.$ $\dfrac{m+1}{n}+p$ is an integer.
Here we have $p=1/2,n=-4/3,m=1/3$
Since you are going to do the integral numerically, there is no loss in finding $y$-values numerically as well. Since the function you integrate is $2\pi$-periodic, and you want to integrate it over its period $[0,2\pi]$, there is no need for advanced methods like Simpson's rule or Gaussian quadrature; the simple left endpoint rule will do just fine.
Here is for Sage, which can be used online (in a browser), free of charge. It follows the logic of the Scilab code given below (which I commented in detail).
var('n a b x y s')
n = 1000
a = 0
b = 2*pi
h = (b-a)/n
s = 0
for i in range(n):
x = a + i*h
s = s + find_root(y^2+sin(4*y*cos(x))-4, 1.5, 2.5)
float((b-a)/n*s)
The only difference, besides syntax, is that Sage asks for an interval in which to look for the root. I gave it $[ 1.5, 2.5]$, because your plot shows that the solution is in this range.
Here is code is for Scilab (requires installation, but is free), Text after //
are my comments.
function z=f(y)
z = y^2+sin(4*y*cos(x))-4 // implicit equation
endfunction
n = 1000 // number of sub intervals
a = 0 // left endpoint
b = 2*%pi // right endpoint
h = (b-a)/n // size of subinterval
p = a:h:b // partition points, the last one (b) won't be used
v = [] // array to hold the values of function
for i = 1:n
x = p(i) // set x equal to partition point
v = [v, fsolve(2,f)] // solve for y, taking y=2 as initial guess
end
integral = h*sum(v) // left endpoint rule
mfprintf(6, '%.9f', integral) // formatted output, 9 digits
Output: $12.567055628$. I got the same answer for $n=2000$ subintervals, so it looks accurate.
Not coincidentally, this is close to $4\pi$, because the values of the function are close to $2$ on average.
Best Answer
You use thr Rienmann integral. Then $A=\int_{-2 }^3(x^3-x^2-6x) dx=[x^4/4-x^3/3-3x^2]_{x-2}^{x=3}$. This is the area with sign. If you want the area without sign: $A= \int_{-2} ^0(x^3-x^2-6x) dx- \int_{0} ^3(x^3-x^2-6x) dx $. The polynomial is negative in $[0,3]$.