Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

Hi am a student in chemical engineering and I have the necessity to rearrange formulas algebraically, for example

 Cco[t] == (Exp^(-((t v0)/V))*(-Fcoa + Exp^((t*v0)/V) Fcoa - 
             Fcos + Exp^((t*v0)/V) Fcos + CCo0 v0))/v0

I have to find the expression for t... It is a simple algebraic manipulation that I can do manually.. How is it possible to do this with mathematica? Thanks a lot

share|improve this question

marked as duplicate by Artes, PlatoManiac, Dr. belisarius, Michael E2, R. M. Feb 17 '14 at 0:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

could you try to use mathematica syntax? – george2079 Feb 16 '14 at 21:26
You probably meant E^... (not that this changes a iota about the difficulty of reproducing elementary simplifications in Mathematica) – Peltio Feb 16 '14 at 21:26
A duplicate of that question? Seriously? – Peltio Feb 17 '14 at 0:50

During the years I developed this peculiar idea that that best way to use Mathematica is to use it to the least possible extent. Hence, if you can do a simplification by hand, do it by hand.

The problem with Mathematica is that that software is sometimes too smart - or too dumb, depending on the point of view. Some behaviors of MMA that stand in the way of performing 'trivial simplifications' are:

  1. MMA considers the most general case of a complex variable, while in doing a simplification by hand, one can make- almost without realizing it - the most relevant assumptions. Assuming and Assumputions can help MMA see "the obvious" when it fails to produce the expect result.
  2. MMA does not know physics, nor chemistry. Hence it might not be able to select, for example, only the real or the real and positive solution when there are multiple solutions.
  3. MMA does not have a semantic pattern matching, meaning that you might end up specifying a pattern that do not correspond to the internal representation of what you see in your initial equation. Roots,complex and fractional expressions are unexpectedly hard to match.

All that said, sometimes you might want to reproduce the steps of a resolution 'by hand'. In that case, you can make Mathematica less smart by hiding part of the expression. Let's start from your expression just like you typed (even if you probably meant E instead of Exp)

Cco[t] == (Exp^(-((t v0)/V))*(-Fcoa + Exp^((t*v0)/V) Fcoa - Fcos + Exp^((t*v0)/V) Fcos + CCo0 v0))/v0

We can work on the right hand side to avoid carrying along the equation sign.

Expand[(Exp^(-((t v0)/V))*(-Fcoa + Exp^((t*v0)/V) Fcoa - Fcos + Exp^((
        t*v0)/V) Fcos + CCo0 v0))/v0]

we get and expression that only has Exp^(-((t v0)/V)) terms. We can collect them using Collect, like this

Collect[%, Exp^(-((t v0)/V))]

Then, we can go back to the equation, by adding ==Cco. Only, it is better to replace the exponential with a dummy variable, let's call it x.

% == Cco /. Exp^(-((t v0)/V)) -> x

If we solve for x and then equate the solution to Exp^(-((t v0)/V)) we can finally solve for t

Exp^(-((t v0)/V)) == x /. First[Solve[%,x]]

Solve[%, t]

And there you have it. Personally, I prefer pencil and paper.

share|improve this answer
Thanks a lot :) very kind! – nino Feb 27 '14 at 21:01

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