Question: Plot two function in the same graph

Dear all;

Thank you for helping me, to plot two function on the same graph.

 

restart;
with(plots):

ode := diff(y(x), x, x) = x*y(x)+x;
a:=2; b:=3;  # we work in the interval (a,b)
ics := y(a) = 0, y(b) = 1;
sol:=dsolve({ode,ics}, numeric):  # Solution of my ode

# First figure: solution of my ode in the interval (2,3)

odeplot( sol,[x, y(x)], x=a..b);  # I plot the solution in the interval (a,b)

# Here I define a second function

z:=x->-4.9354831550*exp(-(2/3)*x^(3/2))/(x^(1/4)*sqrt(Pi))+0.752447265e-1*exp((2/3)*x^(3/2))/(x^(1/4)*sqrt(Pi))+(16/153)*x^(7/6)*sqrt(Pi)*exp((2/3)*x^(3/2))+Pi*((1/2)*exp(-(2/3)*x^(3/2))*(-1+exp((2/3)*x^(2/3)))/(x^(1/4)*Pi)-(16/153)*x^(7/6)*exp((2/3)*x^(3/2))/sqrt(Pi));

# Here a code to plot this function z

forget(evalf):
Digits:=20:
P1:=plottools:-transform((x,z)->[x+a,z])(plot(expand(z(x+a)),x=0..1)):
forget(evalf): Digits:=4000:
P2:=plot(z, a..b, style=point,adaptive=false, numpoints=25):
plots:-display(P1,P2);  # Second figure

My question: I want one graph that shows the solution of my ode and the funciton z. ( i.e plot the two figures in only one graph).

Thanks for helping me.

 

 

 

 

 

 

 

Please Wait...