0
$\begingroup$

I'm trying to learn how to add constraints/assumptions to equations when using Solve, sp as to avoid multi-valued solutions. For example, I'm trying to use Mathematica 11.3 to solve the equation

n Sin[theta] == Sin[alpha]

for theta, where I know n > 1 and that the solution is in the first quadrant; i.e., 0 < theta < Pi/2).

I tried

Solve[{n Sin[theta] == Sin[alpha], alpha > 0, alpha < π/4, θ > 0, θ < π/2}, theta]

and got the solution:

{{theta -> 
   Conditional
    Expression[π - ArcSin[Sin[alpha]/n] + 2 π C[1], 
    C[1] ∈ Integers && 0 < alpha < π/4 && 0 < θ < π/2]}, 
 {theta -> 
   ConditionalExpression[
     ArcSin[Sin[alpha]/n] + 2 π C[1], 
     C[1] ∈ Integers && 0 < alpha < π/4 && 0 < θ < π/2]}}

which seems needlessly complex to me. I tried to simplify this solution, as suggested here: but it didn't simplify. I was hoping it would reduce to

ArcSin[Sin[alpha]/n]
$\endgroup$

closed as off-topic by m_goldberg, MarcoB, Bob Hanlon, bbgodfrey, José Antonio Díaz Navas Mar 21 at 19:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – m_goldberg, MarcoB, Bob Hanlon, bbgodfrey, José Antonio Díaz Navas
If this question can be reworded to fit the rules in the help center, please edit the question.

3
$\begingroup$

I think the problem is that θ is not the same as theta. Fixing that, and also adding your constraint on n:

Solve[
  {n Sin[theta] == Sin[alpha], alpha > 0, alpha < π/4, theta > 0, theta < π/2, n > 1}, 
  theta]

yields

{{theta -> ConditionalExpression[ArcSin[Sin[alpha]/n], 0 < alpha < π/4 && n > 1]}}
$\endgroup$
  • 1
    $\begingroup$ Assuming[assume =0 < alpha < Pi/4 && 0 < theta < Pi/2 && n > 1, Solve[n Sin[theta] == Sin[alpha] && assume, theta] // Simplify][[1]] $\endgroup$ – Bob Hanlon Mar 19 at 4:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.