I used integrals and integrates commands to integrate functions containing square roots using Python's sympy module, but the results didn't come out well...
For example,
root{(x^2+1)}
I wrote the code to integrate the same function.
import sympy as sm
x=sm.Symbol('x')
f=(x**2+1)**(0.5)
g=sm.Integral(f,x).doit()
print(g)
I can't get the results.
How do you integrate the functions in the root with Python??
python sympy integral
Of course, there's a symbol x.Only formulas appear before you give a symbol value.
from sympy import Symbol, Integral
x = Symbol('x')
f = (x**2+1)**(0.5)
g = Integral(f,x).doit()
g.evalf()
g.evalf(subs={x:2})
2.9578857150892
© 2024 OneMinuteCode. All rights reserved.