Book
Advanced Engineering Mathematics
Author
Erwin Kreyszig
Edition
8th Edition
x = var('x') # define a variable x y = function('y',x) # define x to be a function of that variable DE = exp(x)*diff(y,x) == 2*(x+1)*y^2 print 'Differential Equation:' show(DE) soln = desolve(DE, [y,x]) print 'Solution:' show(soln) print 'Explicit solution:' soln.solve(y) c = solve(soln.solve(y)[0].rhs().subs(x=0)==1/6,soln.variables()[0]) print 'Integration constant:' show(c) print 'Explicit solution:' soln.solve(y)[0].subs(c=c[0].rhs())
Solution by:
- Pankaj Pandey, Student, IIT Bombay