2
$\begingroup$

I'm trying to compute a definite integral of the form $$\int_{0.2}^{0.5} \frac{1}{(1 - y)y^2\sqrt{0.5 - y^2 + y^3}}$$ in Mathematica. WolframAlpha will calculate this but Mathematica only outputs the integral in nice text.

This is the command I type in

Integrate[1/((1 - y)*y^2*Sqrt[0.5 - y^2 + y^3]), {y, 0.2, 0.5}] 

Is this wrong? If it helps at all Mathematica will on the other hand compute this similar integral with no constant under the square root. $$\int_{0.2}^{0.5} \frac{1}{(1 - y)y^2\sqrt{- y^2 + y^3}}$$

$\endgroup$
3
  • $\begingroup$ use NIntegrate. I suppose alpha automatically switches to numeric integration, with mathematica you need to tell it to. (your second integral has a nice closed form ) $\endgroup$ Commented Mar 9, 2015 at 20:22
  • 1
    $\begingroup$ incedentally there is an analytic antiderivative so you can do this: indef = Integrate[1/((1 - y)*y^2*Sqrt[1/2 - y^2 + y^3]), y]; (indef /. y -> .5 ) - (indef /. y -> .2) // N // Chop. indef is such a nasty expression i'm not sure there is any advantage over using NIntegrate $\endgroup$ Commented Mar 9, 2015 at 20:29
  • $\begingroup$ Thank you! I have in fact an analytic solution in a book written in terms of elliptic integrals and was trying to compare the latter with direct numerical integration. $\endgroup$ Commented Mar 9, 2015 at 20:35

2 Answers 2

3
$\begingroup$

The numerical result you received on WolframAlpha is the result of a numerical integration:

NIntegrate[1/((1 - y) y^2 Sqrt[0.5 - y^2 + y^3]), {y, 0.2, 0.5}] 
6.68687 

Or

N@Integrate[1/((1 - y)*y^2*Sqrt[0.5 - y^2 + y^3]), {y, 0.2, 0.5}] 
6.68687 
$\endgroup$
2
$\begingroup$
Integrate[1/((1 - y)*y^2*Sqrt[1/2 - y^2 + y^3]), y] // ToRadicals 

Gives you the symbolic thing

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.