wintertreey 님의 블로그
5.7 연습문제 (미완) 본문
1. 함수의 부정적분 구하기
++ 에러문
ModuleNotFoundError: No module named 'sympy'
cmd창에서 sympy 설치하기
pip install sympy
import sympy as sp
# a.
x = sp.Symbol('x')
f = x**2+3*x+2
F = sp.integrate(f,x)
print(F)
# F = sp.integrate(f, x) + sp.Symbol('C') # 적분상수 C 추가
# b.
f = sp.exp(x) - 1/x
F = sp.integrate(f,x)
print(F)
# c.
f = (x+1)**2 * (x-2)
F = sp.integrate(f,x)
print(F)
# d.
f = (3**x - 1)**2
F = sp.integrate(f,x)
print(F)
# e.
f = sp.sin(x)**3
F = sp.integrate(f,x)
print(F)
# f.
f = x**2 * sp.log(x)
F = sp.integrate(f,x)
print(F)x**3/3 + 3*x**2/2 + 2*x
exp(x) - log(x)
x**4/4 - 3*x**2/2 - 2*x
x + (3**(2*x)*log(3) - 4*3**x*log(3))/(2*log(3)**2)
cos(x)**3/3 - cos(x)
x**3*log(x)/3 - x**3/9

4. 함수의 부정적분 구하기
# a.
x = sp.Symbol('x')
f = 1/(x*(x+1))
F = sp.integrate(f,x)
print(F)
# log(x) - log(x + 1)
# b.
f = (2*x-3) / (x**2 - 3*x + 2)
F = sp.integrate(f,x)
print(F)
# log(x**2 - 3*x + 2)


'수학' 카테고리의 다른 글
| 5.6 적분의 응용 (0) | 2025.11.25 |
|---|---|
| 5.4 부분적분법 (0) | 2025.10.15 |
| 5.3 치환적분법 (0) | 2025.09.23 |
| 5.5 정적분, 부정적분 (0) | 2025.09.16 |
| 4.7 미분의 응용 (0) | 2025.09.10 |