Question: How can I check the numerical solution of my differential equation?

Hello

 

I have the following nonlinear differential equation:

deq := (diff(y(x), x, x))*y(x)-1+x*y(x)^2 = cos(x);

I solved it numerically:

sol := dsolve({deq, y(0) = 1, (D(y))(0) = 1}, numeric);

ysol := proc (x) options operator, arrow; rhs(sol(x)[2]) end proc;

plot('ysol(x)', x = 0 .. 5);

but I would like to substitute it to the left side of deq and plot it, to be sure that it's plot is the same as cos(x).

But I don't know how.

 

Please help me,

Lendo

 

 

 

Please Wait...