I want to obtain the volume of a function with a double integral. To solve this problem y have to evaluate in respect to x +-sqrt(y-y^2) but when I try to substitute I get this error:
Error:
NIntegrate[func1, {x, -Sqrt[y - y^2], Sqrt[y - y^2]}, {y, 0, 1}]
NIntegrate[func2, {x, -Sqrt[y - y^2], Sqrt[y - y^2]}, {y, 0, 1}]
My code:
func1 = 1 - y^2 - x^2
func2 = 1 - y
NIntegrate[func1, {x, -Sqrt[y - y^2], Sqrt[y - y^2]}, {y, 0, 1}]
NIntegrate[func2, {x, -Sqrt[y - y^2], Sqrt[y - y^2]}, {y, 0, 1}]
NIntegrate Is the only way I find to solve a double Integral and get a numerical number, yet I can’t use those limits
Is there a way to get around this error?
NIntegrate[]
, per the docs.NIntegrate[1 - x^2 - y^2, {y, 0, 1}, {x, -Sqrt[y - y^2], Sqrt[y - y^2]}]
(Compare this with the more natural specificationNIntegrate[1 - x^2 - y^2, {x, y} ∈ Disk[{0, 1/2}, 1/2]]
.) $\endgroup$NIntegrate
can only provide a numerical result if the integrand is a numerical function (it is here), and likewise are the limits of integration (they are not). $\endgroup$