Lab6temp 151 22C Jupyter Notebook 10 26 22 8 09 PM MATH 151 Lab 6 Put team members names and section number here In 1 from sympy import from sympy plotting import plot plot parametric Question 1 In 2 from sympy import x symbols x r symbols r y exp r x f 2 diff y x 2 diff y x y values solve f r print Values of r for which 2y y y 0 is values 0 and Values of r for which 2y y y 0 is 1 and 1 2 In 3 f diff y x 2 6 diff y x 10 y values solve f r print Values of r for which y 6y 10y 0 is values 0 and Values of r for which y 6y 10y 0 is 3 I and 3 I 1a 1b 1c y 6y 10y 6 sin x cos x exp 3 x 8 sin x co s x exp 3 x 2 7 sin x cos x exp 3 x When factored 0 Using the complex values in b we can conclude that the particular solution of the diffrential equation for b is y e 3x cosx sin x http localhost 8888 notebooks Downloads Lab6temp 151 22C ipynb Page 1 of 5 In 4 y exp 3 x cos x sin x f diff y x 2 6 diff y x 10 y print y 6y 10y f print When factored f factor print Using the complex values in b we can conclude that the particular solution of the diffrential equation for b is y e 3x cosx sinx Lab6temp 151 22C Jupyter Notebook 10 26 22 8 09 PM Question 2 2a In 5 t symbols t x exp 2 sin t y exp cos t derivative diff y t 1 diff x t m derivative subs t pi 6 xval x subs t pi 6 yval y subs t pi 6 tanline yval m x xval print The equation of the tangent line exact is y tanline tanline yval evalf m evalf x xval evalf print The equation of the tangent line in decimal form is y tanline The equation of the tangent line exact is y sqrt 3 exp 2 sin t E exp 1 exp sqrt 3 2 6 exp sqrt 3 2 The equation of the tangent line in decimal form is y 3 063751259 50142 0 252478818450665 exp 2 sin t NUM numer derivative horizontal solve NUM t hx1 x subs t horizontal 0 hy1 y subs t horizontal 0 hx2 x subs t horizontal 1 hy2 y subs t horizontal 1 print f The tangent is horizontal at the points hx1 hy1 and DEN denom derivative vertical solve DEN t vx1 x subs t vertical 0 vy1 y subs t vertical 0 vx2 x subs t vertical 1 vy2 y subs t vertical 1 print f The tangent is vertical at the points vx1 vy1 and The tangent is horizontal at the points 1 E and 1 exp 1 The tangent is vertical at the points exp 2 1 and exp 2 1 2b In 7 2c http localhost 8888 notebooks Downloads Lab6temp 151 22C ipynb Page 2 of 5 Lab6temp 151 22C Jupyter Notebook 10 26 22 8 09 PM In 8 tangents plot parametric t hy1 t 0 2 pi t hy2 t 0 2 pi vx1 vector plot parametric x y t 0 2 pi show False vector extend tangents vector show Question 3 3a In 9 x y symbols x y f x 2 y 2 4 2 x 2 2 5 x 2 y 2 plot implicit f x 5 20 y 15 15 Out 9 sympy plotting plot Plot at 0x7f80023ab760 http localhost 8888 notebooks Downloads Lab6temp 151 22C ipynb Page 3 of 5 Lab6temp 151 22C Jupyter Notebook 10 26 22 8 09 PM 3b 3c 3d In 10 dydx idiff f y x print dy dx dydx dy dx x 3 12 x 2 x y 2 4 y 2 32 y x 2 8 x y 2 32 In 11 DEN denom dydx vertical solve DEN f x y print Vertical tangents at vertical Vertical tangents at 3 2 sqrt 71 2 3 2 sqrt 71 2 4 2 sqrt 5 2 sqrt 7 4 sqrt 5 0 2 sqrt 5 4 2 sqrt 7 4 sqrt 5 0 2 sqrt 5 4 2 sqrt 7 4 sqrt 5 0 2 sqrt 7 4 sqrt 5 4 2 sqrt 5 0 In 12 curve plot implicit f x 5 20 y 15 15 show False t symbols t tangents plot parametric 1 5 t t 15 15 4 2 sqrt 5 2 curve extend tangents curve show http localhost 8888 notebooks Downloads Lab6temp 151 22C ipynb Page 4 of 5 Lab6temp 151 22C Jupyter Notebook 10 26 22 8 09 PM Question 4 4a 4b 4c In 13 x symbols x y log x 0 2 x 3 1 0 5 2 7 x 4 dydx y diff x dydx expand log dydx print dy dx dydx dy dx 2 7 x 4 0 2 x 3 1 0 5 x 0 8 2 7 x 4 28 x 0 2 x 3 1 0 5 2 7 x 5 1 5 x 2 2 2 7 x 4 x 3 1 0 5 x 0 2 x 3 1 0 5 In 15 derivative diff y x print dy dx derivative dy dx 2 7 x 4 0 2 x 3 1 0 5 x 0 8 2 7 x 4 28 x 0 2 x 3 1 0 5 2 7 x 5 1 5 x 2 2 2 7 x 4 x 3 1 0 5 x 0 2 x 3 1 0 5 In 16 simpleB derivative simplify simpleA dydx simplify print Answer to 4a simplified is simpleA print Answer to 4b simplified is simpleB print They are equal Answer to 4a simplified is 28 x 1 0 x 3 1 1 0 x 3 0 1 0 5 x 3 0 1 4 x 0 4 x 3 1 1 0 x 1 0 7 x 2 x 3 1 1 0 Answer to 4b simplified is 28 x 1 0 x 3 1 1 0 x 3 0 1 0 5 x 3 0 1 4 x 0 4 x 3 1 1 0 x 1 0 7 x 2 x 3 1 1 0 They are equal http localhost 8888 notebooks Downloads Lab6temp 151 22C ipynb Page 5 of 5
View Full Document