# Stuck in solving two variables from two expressions

After doing experiment with Michelson interferometer I need to calculate two coefficients: k and n. This involves solving two equations for k and n:

$$\frac{(8 \pi d)}{\lambda }{kn}=\frac{\text{\triangle I}}{I}$$

$$\text{\triangle l}_2=\left\{\frac{\lambda }{2 \pi }\right\} \tan ^{-1}\left(\frac{2 \left(n \sin \left(\frac{4 \pi d n}{\lambda }\right)+k\right)}{\frac{4 \pi d \left(n^2-1\right)}{\lambda }+\left(n^2+1\right) \cos \left(\frac{4 \pi d n}{\lambda }\right)}\right)$$

For the first one I have everything exept $\Delta$*r*. As for second one, I have all coefficients. But Mathematica won't solve it neither with Solve, neither with NSolve.

Solve[{k*n==0.00730621,
1.67/0.00539535==ArcTan[(2(k+n Sin[8.89655n]))/(8.89655(-1+n^2)+(1+n^2)Cos[8.89655 n])]},
{k,n}]


It just goes into ever increasing evaluation till computer starts to freeze or I stop evaluation.

Could anyone suggest how I tackle this problem? Thanks.

• Welcome to Mathematica! 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!
– user9660
Oct 7, 2015 at 17:59
• please put the complete code here. Oct 7, 2015 at 18:18
• Perhaps start by solving the first equation for, say, n, plugging that into the second equation, then plotting that equation as a function of n and seeing roughly where the roots are. Then use FindRoot. Oct 7, 2015 at 19:12
• Thanks for response. @RaymondGhaffarianShirazi - it is all the code. I'm just trying to use Mathematica to calculate k,n. Oct 7, 2015 at 19:48
• Solve for k in terms of n and plug the result into the second equation. Then Plot[ f[n] , {n,-10,10}] to see that there is no zero. This suggests that there is something strange with the parameter numbers calculated before. Oct 7, 2015 at 22:59

Following March's suggestion, if one takes the first expression we can determine that k is:

0.00730621/n


Create a function of n that represents the second equation. Replace k in the second equation with the above expression:

eq2[n_] := 1.67/0.00539535 - ArcTan[(2 (0.00730621/n + n Sin[8.89655 n]))/
(8.89655 (-1 + n^2) + (1 + n^2) Cos[8.89655 n])]


Plot it as a function of n. Since the equation has 8.89655 n as an argument to Sin and Cos it makes sense to limit n to be less than 8.89655/(2 π).

There is a discontinuity where the denominator goes to zero so it is excluded from the plot.

Plot[eq2[n], {n, 0, 8.89655/ (2 π)},
PlotRange -> {{0, 1.5}, {-1.8, 1.8}},
Exclusions -> {(8.89655 (-1 + n^2) + (1 + n^2) Cos[8.89655 n]) == 0}
]


The plot shows that eq2 never approaches zero. At the discontinuity the ArcTan jumps from -π/2 to π/2.

• Thanks a lot! @JackLaVigne I just don't understand why you dont use LHS of second equation. Oct 8, 2015 at 7:16
• @JustasJ - Terribly sorry. 100% error on my part. The equation should be modified as shown by Willinski below. Following his and Kagaratsch's comment, it is clear that there is no solution. Oct 8, 2015 at 12:48
• I have edited my answer accordingly. Oct 8, 2015 at 13:08
• Thanks for going through all the trouble! @JackLaVigne Oct 8, 2015 at 15:10

There are no zeros (see @Kagaratsch comment).

n = 0.00730621/k;
eq = 1.67/0.00539535 - ArcTan[(2 (k +n Sin[8.89655 n]))/(8.89655 (-1 + n^2) + (1 + n^2) Cos[8.89655 n])] // FullSimplify


Plot[eq, {k, -0.1, 0.1}, PlotRange -> All]