1
$\begingroup$

Solutions returned by Solve are provided as rules:

solnRule1 = 
  y -> 1/(3 (1 + x)) - (-1 + 2 x)/(6 (1 - x + x^2)) + 2/(
    3 (1 + 1/3 (-1 + 2 x)^2));

Solutions returned by Reduce are provided as equations:

solnEqn1 = 
  y == 1/(3 (1 + x)) - (-1 + 2 x)/(6 (1 - x + x^2)) + 2/(
    3 (1 + 1/3 (-1 + 2 x)^2));

It has been my experience that Simplify treats both of these the same:

Simplify@solnRule1
Simplify@solnEqn1

enter image description here

However, that is not the case for these identical solutions:

 solnRule2 = 
  y -> -((-10 cF Ee F Log[10] + 10 cF Epzc F Log[10] - 
     23 cF pH R T Log[10] + 23 cF pKa R T Log[10] + 
     23 cF R T Log[f/(1 - f)])/(10 F Log[10]));
 solnEqn2 = 
  y == -((-10 cF Ee F Log[10] + 10 cF Epzc F Log[10] - 
     23 cF pH R T Log[10] + 23 cF pKa R T Log[10] + 
     23 cF R T Log[f/(1 - f)])/(10 F Log[10]));

When Simplify is applied to the rule-based version of the above solution, it acts normally:

Simplify@solnRule2

enter image description here

But when Simplify is applied to the equation-based version, it equates the solution to zero:

Simplify@solnEqn2

enter image description here

I don't know why Simplify is doing this. When I convert solnEqn2 to a rule-based format, it behaves normally:

ToRules@solnEqn2
Simplify@%

enter image description here

This can cause problems when applying Simplify to the output of Reduce: Reduce can provide solutions to several different variables, and when one solution is equated to zero it can be difficult to determine the variable it represents.

I'm using:

enter image description here

$\endgroup$
7
  • $\begingroup$ I get the Solve solution, plus a couple of other cases, with Reduce in V12.2. $\endgroup$
    – Michael E2
    Commented May 15, 2021 at 4:32
  • $\begingroup$ @MichaelE2 That's odd, because I'm also using V12.2 (on MacOS 10.13.6); I just added a screenshot indicating this. And I reconfirmed the behavior by quitting/reopening MMA and then pasting directly from my post. Are you using MMA for Windows or Linux and, if so, might that account for the difference? OTOH, if you're on a Mac, I should try re-downloading and reinstalling the program. $\endgroup$
    – theorist
    Commented May 15, 2021 at 4:52
  • 1
    $\begingroup$ I'm on a Mac (11.3.1). This is what I get: i.sstatic.net/G5BQg.png -- The third solution (third part of the Or) is equivalent to the Solve solution. Uh-oh, I just tried applying Simplify and the Solve solution disappears. I guess that explains the diff. It may be a bug (in Solve perhaps); but it's quite late here, and I don't want to try to figure that out right now. Or perhaps Simplify does a generically correct transformation that erroneously eliminates the solution. $\endgroup$
    – Michael E2
    Commented May 15, 2021 at 5:22
  • $\begingroup$ @MichaelE2 I see the same thing. [Though I think what you meant to say was "I just tried applying Simplify and the Reduce solution disappears" -- as you said, it's currently late where you are :).] Since you identified the problem as resulting not from Reduce by itself, but rather from the application of Simplify to Reduce's solution, I rewrote my question. $\endgroup$
    – theorist
    Commented May 15, 2021 at 19:20
  • $\begingroup$ It was late and maybe I didn't look closely enough. These give the same result: Solve[Simplify[red], \[Sigma]M] and Solve[sys, \[Sigma]M, {Vs, VF}], where sys is the system in the first Reduce. $\endgroup$
    – Michael E2
    Commented May 15, 2021 at 19:34

1 Answer 1

0
$\begingroup$

There's a simple explanation for this (thanks to WRI tech support for pointing this out).

When Simplify acts on Simplify@solnEqn2, it's acting on the equation as a whole, rather just on the RHS of the expression (the latter is what Simplify does when the solution is expressed as a rule), to put the equation into what its algorithm determines is the simplest form.

What I missed is that, in so doing, in this particular case, Simplify inserted the variable (f) into the equation itself, to obtain an expression that equals zero. This can be seen more clearly if we use a more distinctive variable (XXXX):

solnEqn2A = 
  XXXX == -((-10 cF Ee F Log[10] + 10 cF Epzc F Log[10] - 
        23 cF pH R T Log[10] + 23 cF pKa R T Log[10] + 
        23 cF R T Log[f/(1 - f)])/(10 F Log[10]))
Simplify@solnEqn2A

enter image description here

The take-home message is that, if you ask Reduce to isolate specific variables, that isolation may be lost if you apply Simplify to Reduce's output. [Or, more generally, that variable isolation can be lost anytime a solution is in equation form.] One solution is to use ToRules before applying Simplify.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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