Mathematica outputs an answer using Solve[] but it is not as simplified as it can be. By manually arranging this expression I know that the parts I've highlighted in yellow can actually be simplified very heavily. I can't use a function like Together[] because I only want to simplify part of the expression (highlighted in yellow)

enter image description here

From manually arranging this I know the whole expression can be written as the following. Notice the highlighted part can be simplified into one simple fraction.

enter image description here

I would be very appreciative if someone can help me with this targeted simplification of what I've highlighted in yellow! And even better yet, it would be great if I could get the expression to output exactly what I've derived by hand (which I guess would involve two separate simplifications?)

I've simplified my code to the following:

rdot = 1/2 epsilon (-(r/Q) + (Fo Sin[\[Alpha]])/(k z))
phidot = (epsilon (-((H R)/(1 - r^2)^(3/2)) - (3 Fo z^2 Cos[\[Alpha]])/r))/(6 k z^3)

alphadot = epsilon*sigma - phidot

sol = Solve[rdot == 0 && alphadot == 0, {sigma, \[Alpha]}]
  • $\begingroup$ If you apply Simplify to the highlighted part (copy it from the output into a new cell), you get something pretty close to your handwritten expression (it seems you have lost a factor) - or is this not what you want? $\endgroup$
    – Lukas Lang
    Commented Feb 28, 2019 at 12:48
  • $\begingroup$ Thank you! This works and gets the same answer but it involves manually selecting what to simplify. Is there a chance this can be done automatically? $\endgroup$ Commented Feb 28, 2019 at 13:56

2 Answers 2


One can do such kind of things in a fine way. For example, let us make the replacement only in the first solution. Let us define

expr = Plus[Simplify[Take[sol[[1, 1, 2, 2]], 4]], 
  sol[[1, 1, 2, 2, 5]]],

where sol is your solution. The result is

enter image description here Now, if you wish to insert it into the original solution,

ReplacePart[sol, {1, 1, 2, 2} -> expr]

then the first line of the result is shown in the image below.

enter image description here

Have fun!


A solution for yellow part:

Simplify[sol[[All, 1, 2, 2, 1 ;; 4]]*sol[[All, 1, 2, 1]]] + sol[[All, 1, 2, 2, 5]]*sol[[All, 1, 2, 1]]

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.