This code:

 

import sympy as sm

x = sm.symbols('x')   

f = sm.integrate(sm.sqrt(1-x**2), (x, 0, 1))

print('f=', f)

 

gives:

f = pi /4

 

From: [email protected] <[email protected]> On Behalf Of Ajith Kumar
Sent: Dienstag, 23. April 2024 10:43
To: sympy <[email protected]>
Subject: [sympy] Area of circle by integration

 

 

from sympy import *

x,y = symbols('x y')
y = sqrt(1 - x**2)

integrate(y,x ,(x, 0, 1)).evalf()

 

result is

0.452064830064115

 

I expected  value of Pi/4, by integrating a quarter of a circle with unit 
radius. Can anyone explain the reason, I am new to Simpy.

 

Regards

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected] 
<mailto:[email protected]> .
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/4bfbada5-0317-4272-a854-169e3ae6903cn%40googlegroups.com
 
<https://groups.google.com/d/msgid/sympy/4bfbada5-0317-4272-a854-169e3ae6903cn%40googlegroups.com?utm_medium=email&utm_source=footer>
 .

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/001d01da95b7%2436906f00%24a3b14d00%24%40gmail.com.

Reply via email to