# Define an exponential function
h = sp.exp(x)
# Compute the indefinite integral
H = sp.integrate(h, x)
print("∫exp(x) dx =", H)
#clcoding.com
import sympy as sp
# Define the variable and function
x = sp.Symbol('x')
f = x**2 + 3*x + 2
# Compute the indefinite integral
F = sp.integrate(f, x)
print("∫f(x) dx =", F)
#clcoding.com
# Define the range and compute the definite integral
a = 0
b = 1
integral_value = sp.integrate(f, (x, a, b))
print("∫f(x) dx from", a, "to", b, "=", integral_value)
#clcoding.com
# Define a trigonometric function
g = sp.sin(x)
# Compute the indefinite integral
G = sp.integrate(g, x)
print("∫sin(x) dx =", G)
#clcoding.com
0 Comments:
Post a Comment