Math Lab 5-3 PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

3/1/2020 Untitled1 - Jupyter Notebook

In [27]:  from sympy import *


from sympy.plotting import (plot, plot_parametric,plot3d_parametric_surface,p

In [28]:  # Problem 3
# Part A
x,u = symbols('x,u')
f = (E**(2*x)) / (E**(2*x) + 3*E**x + 2)
new = f.subs(E**x,u)
new

Out[28]: 𝑢2
𝑢2 + 3𝑢 + 2
In [29]:  # Part B
fnew = apart(new,u)
fnew

Out[29]:
1 − 𝑢 +4 2 + 𝑢 +1 1
In [30]:  # Part B integration
f2 = fnew.subs(u,E**x)
integral = integrate(f2,x)
integral

Out[30]: −log(𝑒𝑥 + 1) + 2log(𝑒𝑥 + 2)


In [31]:  # Part C
integral2 = integrate(f,x)
integral2

Out[31]: −log(𝑒𝑥 + 1) + 2log(𝑒𝑥 + 2)

localhost:8888/notebooks/Untitled1.ipynb?kernel_name=python3 1/1

You might also like