# How to use Mathematica to solve this "simple" equation?

I tried to solve this equation using mathmatica 13.2 but failed. I'm a noob to Mathematica, is MMA able to solve this equation? Thank you!

(PS. How to show λ rather than \[Lambda] in forum? I just copy the code from .nb to the webpage and automatically show as \[Lambda])

ClearAll["Global*"]
eq = Arg[\[Lambda]/(E^((I*\[Omega])/kf)*(1 - (1 - \[Lambda])/E^((I*\[Omega])/kf)))] == \[Pi]/4;
Solve[eq, \[Omega], Assumptions -> {kf > 0, \[Lambda] > 0, \[Lambda] != 1, \[Omega] > 0, \[Omega] < 2*\[Pi]}]

• SE Toolbar post and github link.
– Syed
Commented Apr 5, 2023 at 5:56

Clear["Global*"]

eq = Arg[λ/(E^((I*ω)/kf)*(1 - (1 - λ)/E^((I*ω)/kf)))] == π/4;


Use ComplexExpand to simplify the equation

eq2 = Assuming[{kf > 0, λ > 0, λ != 1, ω > 0, ω < 2*π},
ComplexExpand[eq, TargetFunctions -> {Re, Im}] // Simplify]

(* 4 ArcTan[-1 + λ + Cos[ω/kf], -Sin[ω/kf]] == π *)


EDIT: Removed Quiet to show warning messages

Column[sol =
Assuming[{kf > 0, λ > 0, λ != 1, ω > 0, ω < 2*π},
SolveValues[eq2, ω, Reals, Method -> Reduce] //
FullSimplify]]


Plot3D[Evaluate[sol[[1]] /. C[1] -> 1], {λ, 10^-6, 3}, {kf, 10^-6, 1},
PlotPoints -> 50,
MaxRecursion -> 3,
WorkingPrecision -> 15]


Plot3D[Evaluate[sol[[2]] /. C[1] -> 1], {λ, 15/8, 5/2}, {kf, 10^-6, 1},
PlotPoints -> 50,
MaxRecursion -> 3,
WorkingPrecision -> 15]


• Why do you use Quiet? What error message is produced? Commented Apr 5, 2023 at 6:33
• @user64494 - added warning messages Commented Apr 5, 2023 at 14:48

This can be done as follows. First, we apply that Arg[z]==Pi/4 is equivaletnt to Re[z]==Im[z]&&Re[z]>=0. Second, we obtain a polynomial equation instead of a trig equation. Hence,

eq1 = ComplexExpand[Re[\[Lambda]/(E^((I*\[Omega])/kf)*
(1 - (1 - \[Lambda])/E^((I*\[Omega])/kf)))]] ==
ComplexExpand[Im[\[Lambda]/(E^((I*\[Omega])/kf)*(1 - (1 - \[Lambda])/E^((I*\[Omega])/kf)))]];
Solve[kf > 0 && \[Lambda] > 0 && \[Lambda] != 1 && \[Omega] >
0 && \[Omega] < 2*\[Pi] && 1 == s^2 + t^2 &&
ComplexExpand[
Re[\[Lambda]/(E^((I*\[Omega])/kf)*(1 - (1 - \[Lambda])/
E^((I*\[Omega])/kf)))]] > 0 &&
eq1 /. {Sin[\[Omega]/kf] -> t, Cos[\[Omega]/kf] -> s}, {s, t}, Reals] // InputForm


{{s -> ConditionalExpression[ (1 - \[Lambda])/2 - Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/ 2, kf > 0 && Inequality[0, Less, \[Omega], Less, 2*Pi] && Inequality[2, Less, \[Lambda], Less, Root[-1 + 8*#1^2 - 8*#1^3 + 2*#1^4 & , 4, 0]]], t -> ConditionalExpression[ -1/2*1/(-1 + \[Lambda]) + Sqrt[(1 + 4*((1 - \[Lambda])/2 - Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2) - 4*\[Lambda]*((1 - \[Lambda])/2 - Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2) - 4*((1 - \[Lambda])/2 - Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2)^ 2 + 8*\[Lambda]*((1 - \[Lambda])/2 - Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2)^ 2 - 4*\[Lambda]^2*((1 - \[Lambda])/2 - Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2)^ 2)/(-1 + \[Lambda])^2]/2, kf > 0 && Inequality[0, Less, \[Omega], Less, 2*Pi] && Inequality[2, Less, \[Lambda], Less, Root[-1 + 8*#1^2 - 8*#1^3 + 2*#1^4 & , 4, 0]]]}, {s -> ConditionalExpression[ (1 - \[Lambda])/2 - Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/ 2, kf > 0 && Inequality[0, Less, \[Omega], Less, 2*Pi] && Inequality[ Root[-1 + 8*#1^2 - 8*#1^3 + 2*#1^4 & , 4, 0], Less, \[Lambda], Less, 1 + Sqrt[2]]], t -> ConditionalExpression[ -1/2*1/(-1 + \[Lambda]) - Sqrt[(1 + 4*((1 - \[Lambda])/2 - Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2) - 4*\[Lambda]*((1 - \[Lambda])/2 - Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2) - 4*((1 - \[Lambda])/2 - Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2)^ 2 + 8*\[Lambda]*((1 - \[Lambda])/2 - Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2)^ 2 - 4*\[Lambda]^2*((1 - \[Lambda])/2 - Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2)^ 2)/(-1 + \[Lambda])^2]/2, kf > 0 && Inequality[0, Less, \[Omega], Less, 2*Pi] && Inequality[ Root[-1 + 8*#1^2 - 8*#1^3 + 2*#1^4 & , 4, 0], Less, \[Lambda], Less, 1 + Sqrt[2]]]}, {s -> ConditionalExpression[ (1 - \[Lambda])/2 + Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/ 2, kf > 0 && Inequality[0, Less, \[Omega], Less, 2*Pi] && Inequality[1, Less, \[Lambda], Less, Root[-1 + 8*#1^2 - 8*#1^3 + 2*#1^4 & , 3, 0]]], t -> ConditionalExpression[ -1/2*1/(-1 + \[Lambda]) + Sqrt[(1 + 4*((1 - \[Lambda])/2 + Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2) - 4*\[Lambda]*((1 - \[Lambda])/2 + Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2) - 4*((1 - \[Lambda])/2 + Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2)^ 2 + 8*\[Lambda]*((1 - \[Lambda])/2 + Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2)^ 2 - 4*\[Lambda]^2*((1 - \[Lambda])/2 + Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2)^ 2)/(-1 + \[Lambda])^2]/2, kf > 0 && Inequality[0, Less, \[Omega], Less, 2*Pi] && Inequality[1, Less, \[Lambda], Less, Root[-1 + 8*#1^2 - 8*#1^3 + 2*#1^4 & , 3, 0]]]}, {s -> ConditionalExpression[ (1 - \[Lambda])/2 + Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/ 2, (Inequality[0, Less, \[Lambda], Less, 1] && Inequality[0, Less, \[Omega], Less, 2*Pi] && kf > 0) || (Inequality[2, Less, \[Lambda], Less, Root[-1 + 8*#1^2 - 8*#1^3 + 2*#1^4 & , 4, 0]] && Inequality[0, Less, \[Omega], Less, 2*Pi] && kf > 0) || (Inequality[Root[-1 + 8*#1^2 - 8*#1^3 + 2*#1^4 & , 3, 0], Less, \[Lambda], Less, 2] && Inequality[0, Less, \[Omega], Less, 2*Pi] && kf > 0) || (Inequality[Root[-1 + 8*#1^2 - 8*#1^3 + 2*#1^4 & , 4, 0], Less, \[Lambda], Less, 1 + Sqrt[2]] && Inequality[0, Less, \[Omega], Less, 2*Pi] && kf > 0)], t -> ConditionalExpression[ -1/2*1/(-1 + \[Lambda]) - Sqrt[(1 + 4*((1 - \[Lambda])/2 + Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2) - 4*\[Lambda]*((1 - \[Lambda])/2 + Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2) - 4*((1 - \[Lambda])/2 + Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2)^ 2 + 8*\[Lambda]*((1 - \[Lambda])/2 + Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2)^ 2 - 4*\[Lambda]^2*((1 - \[Lambda])/2 + Sqrt[1 + 2*\[Lambda] - \[Lambda]^2]/2)^ 2)/(-1 + \[Lambda])^2]/2, (Inequality[0, Less, \[Lambda], Less, 1] && Inequality[0, Less, \[Omega], Less, 2*Pi] && kf > 0) || (Inequality[2, Less, \[Lambda], Less, Root[-1 + 8*#1^2 - 8*#1^3 + 2*#1^4 & , 4, 0]] && Inequality[0, Less, \[Omega], Less, 2*Pi] && kf > 0) || (Inequality[Root[-1 + 8*#1^2 - 8*#1^3 + 2*#1^4 & , 3, 0], Less, \[Lambda], Less, 2] && Inequality[0, Less, \[Omega], Less, 2*Pi] && kf > 0) || (Inequality[Root[-1 + 8*#1^2 - 8*#1^3 + 2*#1^4 & , 4, 0], Less, \[Lambda], Less, 1 + Sqrt[2]] && Inequality[0, Less, \[Omega], Less, 2*Pi] && kf > 0)]}}

I leave the rest on your own.