# coupled differential equation

I want to solve second order differential equation connected with a first-order differential equation

**D[theta[x], {x, 2}] + (2*Z + P)*D[theta[x], x] -Exp[-2*Z*x]*(A*theta[x] + B^2 + C)theta[x]  == 0**,


with boundary conditions theta[0]==1 and theta'[1]==0 and parameters **Z=0.2; A=10;B=0.5; C=0.5; P=0.2;** and the second equation is

**M1==A*theta*Log[1 + T1*theta[x]] - 1/(theta[x] + T1) (2*Z + P)*D[theta[x], x] -Exp[-2*Z*x]*(A*theta[x] + B^2 + C)theta[x])**


I want to solve this equation in such a way to get the value of theta from the 1st equation and use this value in the second equation. and plot M1 against T1. i am new in Mathematica please help me.

• What about parameter x in your second equation? Perhaps you want to plot M1[x,T1]? – Ulrich Neumann Dec 30 '20 at 18:32
• @Ulrich Neumann yes exactly – ZDN Dec 30 '20 at 18:36

parameters (I changed C to CC because C is protected)

Z = 0.2; A = 10; B = 0.5; CC = 0.5; P = 0.2;


solution of the ode

\[Theta] =NDSolveValue[{D[theta[x], {x, 2}] + (2*Z + P)*D[theta[x], x] -Exp[-2*Z*x]*(A*theta[x] + B^2 + CC ) theta[x] == 0,theta[0] == 1 , theta'[1] == 0}, theta, {x, 0, 1}]
(* \[Theta][x] might be used like a build in function of Mathemtica*)


evaluate the second equation

M1 = A*\[Theta][x]*Log[1 + T1*\[Theta][x]] - 1/(\[Theta][x] + T1) (2*Z + P)*D[\[Theta][x], x] -Exp[-2*Z*x]*(A*\[Theta][x] + B^2 + CC) \[Theta][x] ;
(*M1 depends on x and T1*)


plotit

Plot3D[ M1 , {x, 0, 1}, {T1, 0, 5}, AxesLabel -> {"x", "T1", "M1"}]


That's it, hope it helps!

• ! thanks for your cooperation and giving time from your precious time. are any 2D plot is possible – ZDN Dec 30 '20 at 18:51
• What kind of 2D-plots? Something like M1[T1; parameter x] or M1[x; parameter T1] ? – Ulrich Neumann Dec 30 '20 at 18:55
• M1[T1; parameter x] – ZDN Dec 30 '20 at 18:58
• Try Plot[Table[M1, {x, 0, 1, .2}] // Evaluate, {T1, 0, 5}, PlotLegends -> LineLegend[Range[0, 1, .2], LegendLabel -> "x" ]] – Ulrich Neumann Dec 30 '20 at 19:08