Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
20 views
#section 2.2 number 10 y= function('y')(x) # defines the solution as a function de = (y-1)^2*diff(y,x) == 2*x + 3 #defines the differential equation h = desolve (de , y) # solves analytically ( when possible ) show(h)
13y(x)3y(x)2+y(x)=x2+C+3x\displaystyle \frac{1}{3} \, y\left(x\right)^{3} - y\left(x\right)^{2} + y\left(x\right) = x^{2} + C + 3 \, x
# Plotting a sequence of integral curves with a direction field for ODE # example y'=(2*x+1)/(5*y^4+1) which has the implicit solutions y^5+y=x^2+x+C x,y= var('x,y') I=sum(implicit_plot ((1/3)*y^3-y^2+y == x^2+3*x+0.5*c, (x ,-2 ,2) , (y , -2 ,2)) for c in range ( -10 ,30)) # varies the constant c in the general solution y^5+y=x^2+ x+c D= plot_slope_field ((2* x+3) /(y-1)^2 , (x ,-2 ,2) , (y , -2 ,2) , headaxislength =3,headlength =3) # plots the direction field P= implicit_plot ((1/3)*y^3-y^2+y == x^2+3*x, (x ,-2 ,2) , (y , -2 ,2) , color ='orange') # emphasizes a specific solution in orange show (I+D+P) # plots all three on one graph