Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import sympy as sp
- def diff(function, n=1):
- for i in range(n):
- function = sp.diff(function, x)
- return function
- x = sp.symbols('x')
- f1 = sp.tan(x) + 5 * x**3
- f2 = sp.exp(-x) + sp.cos(2 * sp.pi - x**2)
- diff_f1 = diff(f1, 2)
- diff_f2 = diff(f2, 10)
- print(f'а) Відповідь: {diff_f1}')
- print(f'б) Відповідь: {diff_f2}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement