I'm using Solve[LHS[y]==RHS, y]
to generate a solution ruleset, and yet when I apply these rulesets to LHS
I'm not getting RHS
.
Let me be a little clearer. Sorry that the expressions are so large, but I haven't been able to reproduce this with a simpler set of equations.
justSin
is some function of x
and y
. sinOfArcTan
is the same expression but with the substitution y=ArcTan[y2]
.
justSin =
1/2 ((2 Sin[y] Sinh[2 x]) /
(Cosh[2 x] + Cos[y] Sinh[2 x]) ) ^2
sinOfArctan =
1/2 ((2 Sin@ArcTan[y2] Sinh[2 x]) /
(Cosh[2 x] + Cos@ArcTan[y2] Sinh[2 x]) ) ^2
Now I want to solve the following equation:
rhs = 2 Sinh[2 x]^2
justSinSol = FullSimplify@Solve[justSin == rhs, y]
sinOfArctanSol = FullSimplify@Solve[sinOfArctan == rhs, y2]
I get some rules out, the first one's a little complicated but the second is just
{{y2 -> -Csch[2 x]}, {y2 -> Csch[2 x]}}
Now I apply these rules to the original expression:
applyJS = Table[justSin /. justSinSol[[i]], {i, Length[justSinSol]}]
// FullSimplify // Normal
applySA = Table[sinOfArctan /. sinOfArctanSol[[i]], {i, Length[sinOfArctanSol]}]
// FullSimplify // Normal
While applyJS
gives an answer equivalent to rhs
, applySA
does not.
(applyJS - rhs) // FullSimplify (* --> {0,0,0,0} *)
(applySA - rhs) // FullSimplify (* --> not zero *)
I have no idea why this could be the case. I could imagine the introduction of the substitution removing solutions, but I can't see why Mathematica would return a solution which doesn't (seem to) solve the equation.
EDIT:
As @Feyre points out, the solution is valid, but only for x<0
. Why then does Mathematica not return a conditional?