# How to solve a complex equation

I am trying to solve a complex equation for 'z' in terms of 'f'. At the moment my Mathematica is stuck running... Just wondering if anyone has any ideas, I know 0 < z < 40 if that helps.

w1 = 0.3575
w2 = 0.0174
C1 = (5536113736801657*f)/72057594037927936
C2 = -(4347531554729451*f)/75557863725914323419136
C3 = -(3725665976080763*f)/4503599627370496
C4 = (6759318253327467*f)/9007199254740992
d = -w1*C1*Exp[-w1*z] + w1*C2*Exp[w1*z] - w2*C3*Exp[-w2*z] + w2*C4*Exp[w2*z]
dddz = D[d, z]
dd2dz2 = D[dddz, z]
Solve[dd2dz2 == 0, z]

• I just used the plot function and found z is max at z = 0. – Taylor Jul 3 at 11:55

Let's replace the remaining floating point values with rational numbers

w1 = 3575/10000
w2 = 174/10000


, simplify it

expr = Simplify[dd2dz2, z > 0 && f \[Element] Reals]


, which shows that f can be factored out completely, which means f==0 is a solution for every z. We are probably more interested in the non trivial solutions, so let's divide out f to focus on the other solutions

expr2 = Simplify[dd2dz2/f // PowerExpand, z > 0 && f \[Element] Reals]


which is a sum of weighted exponentials in z with different rate coefficients. Reduce is able to give us the two remaining solutions in the form of Root objects:

sol = Reduce[expr2 == 0 && z > 0, z]
sol//N


using N gives us a good numerical approximation. Looking at the InputForm shows that Mathematica keeps perfect analytical solutions in terms of roots of polynomials:

sol//InputForm


ContourPlot[dd2dz2 == 0, {z, 0, 40}, {f, -1 , 1},MaxRecursion-> 4,FrameLabel -> {z, f}]


shows the solution {z,f}