Free lesson · Math & notation
Rearrange an equation without changing its meaning
Open interactive lessonPractice calculationsExplore labs
Start with the idea
Rearranging is bookkeeping for equality. Identify the unknown and undo the operations around it in reverse order, keeping track of the units at each step.
Symbols, units & horizon
- Π: desired net currency profit
- Q: nonzero signed share quantity, positive for a long
- P₀, P₁: entry and exit currency per share
- c: total currency costs, positive for an expense
- Parentheses: calculate the grouped expression first
When and why to use this
Use this to solve for price targets, required quantities or allowable cost budgets.
An equals sign says both sides have the same value. To preserve that equality, perform the same valid operation on both sides. A variable is a placeholder for a number with a defined meaning. Parentheses group operations; calculate what is inside them first.
Undo the operations around the exit price
- Start with . Add c to both sides: .
- Divide both sides by nonzero Q: . Add P₀ to isolate P₁.
Π=36,Q=20,P₀=50,c=4 gives P₁=50+40/20=52.
This trade-profit identity counts quantity Q, entry P₀, exit P₁ and total cost c. Isolating a variable means expressing it in terms of the others. Multiplication can be written as ×, a dot or adjacent symbols. A fraction means division; a zero denominator is invalid.
Python implementation
Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.
def exit_for_profit(entry, quantity, target_profit, total_cost):
"""Price per share; signed shares; profit and cost in currency."""
if quantity == 0:
raise ValueError("Quantity cannot be zero")
return entry + (target_profit + total_cost) / quantity
print(exit_for_profit(50, 20, 36, 4)) # 52Continue learning
Math & Notation Essentials — all lessons- Start with numbers, variables and an equals sign
- Percentages, basis points and units
- Rearrange an equation without changing its meaning
- Powers, square roots, exponentials and logarithms
- Read sums, indices, averages and squared deviations
- Probability, expectation and conditioning
- Vectors, matrices and transpose notation
- Derivatives, integrals and approximations
Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations