Question: Using the result after solving numerically a system of differential equations

restart:

dsys := {diff(x(t),t)=y(t),diff(y(t),t)=-x(t),x(0)=1,y(0)=0}:

dsn := dsolve(dsys,numeric):

dsn(1);          [t = 1., x(t) = HFloat(0.5403023317785669),  y(t) = HFloat(-0.8414711011553073)]

rhs(dsn(1)[2]);                   HFloat(0.5403023317785669)

After solving  this system I wish to obtain a numeric value to the integral:

int(x(t),t=0..1);                    

I tried:

evalf(int(rhs(dsn(t)[2]),t=0..1));

Error, invalid input: rhs received dsn(t)[2], which is not valid for its 1st argument,

I tried many other things without success. Can you help me ?

Please Wait...