# Solving differential equation in

How to integrate and plot the graph between z vs x,

lc = 2.7*10^-3; H = Sqrt lc; B0 =
(H/lc)^2; \ [Theta]t = Pi/2; \[Theta]b = Pi/2;  at (x=0,z=0)

x'[z] = (-Cos[\[Theta]t]*
z + (1 -
z) (Cos[\[Theta]b +
B0/2 z]))/Sqrt[(1 - (-Cos[\[Theta]t]*
z + (1 - z)*(Cos[\[Theta]b + B0/2 z]))^2)]


I am trying using DSolve:

      DSolve[{x'[z] == 0, x == 0}, x, z] // Quiet


I tried my best to decode what you have above as it has syntax error and has mixed text in the code.

DSolve can't solve it

lc = 27/10000;
H  = Sqrt*lc;
B0 = (H/lc)^2;
θt = Pi/2; θb = Pi/2;

(*I am assuming at (x=0,z=0) means initial conditions are zero*)

ic = x == 0;
ode = x'[z] == (-Cos[θt]*z + (1 - z) (Cos[θb + B0/2 z]))/Sqrt[(1 - (-Cos[θt]*z + (1 - z)*(Cos[θb + B0/2 z])))];
DSolve[{ode, ic}, x[z], z] So you could try Numerical

 sol = NDSolveValue[{ode, ic}, x, {z, 0, Pi}];
Plot[sol[z], {z, 0, Pi}] After $$z=\pi$$ the solution becomes complex.

• Thanks@Nasser, It is working. – Gopal Verma Apr 18 at 6:06