Precedence of operators

In simple algebra, there is a set of precedence (priority) of operations that should be respected in order that everyone evaluates mathematical expressions in the same way. Although these rules have been taught in elementary school or junior high school, they are often overlooked.
Here's a review of operators from highest precedence (to be evaluated firt) to lowest.

1. Brackets (parentheses)
2. Exponentiation & roots
3. Multiplication/division
4. Addition/Subtraction.

This set of rules may be abbreviated as BEDMAS for ease of memorization.

When operators of equal precedence are encountered side-by-side, they are evaluated from left to right.

For example, this is how a calculator evaluates the following expression:
2.5+5²*(4+3)/2
=2.5+5²*7/2 ...brackets first
=2.5+25*7/2 ... exponentiation
=2.5+175/2 ... multiplication is to the left of division
=2.5+82.5 .... division before addition
=85

Also, note that in square-roots, the expression under the horizontal bar is equivalent to a set of implicit parentheses. For example, if the whole expression 5&sup3+4*7-1/2 were under the square-root sign, it would be interpreted as:
√(5&sup3+4*7-1/2)

Another frequent oversight has to do with fractions.

Fractions in typeset expressions have the numerator and denominator separated by a horizontal line, such as:

5x²+3x-2
-------------
2x²-x+1

When transcribing fractions to a single line, such as evaluating on a calculator, or posting the expression online, we have to recognize that there are implicit parentheses in both the numerator and denominator. The transcribed one-line expression must have parentheses (brackets) around each of the numerator and denominator, such as:
(5x²+3x-2)/(2x²-x+1)
or else it will be incorrectly interpreted using the BEDMAS rule indicated earlier.

Thus the expression
x+5
---
x+3
would be correctly interpreted as (x+5)/(x+3).

A side note for logical expressions:
====================================
The precedence rule for logical expressions are:

Precedence Operator
1 ¬
2 ∧
3 ∨
4 →
5 ↔

For example:
¬p∧q∨p∧¬q↔T
means
((¬p)∧q)∨(p∧(¬q))↔T

The question asks about the precedence of operators in algebra. The precedence of operators determines the order in which different operations within an expression should be evaluated. This ensures that everyone evaluates mathematical expressions in the same way. The precedence rules for algebraic operators are as follows:

1. Brackets (parentheses): Any expression within brackets should be evaluated first.
2. Exponentiation & roots: Exponentiation (raising a number to a power) and roots should be evaluated next.
3. Multiplication/division: Multiplication and division should be evaluated before addition and subtraction.
4. Addition/subtraction: Finally, addition and subtraction should be evaluated.

These rules can be remembered using the acronym BEDMAS, which stands for Brackets, Exponentiation, Division/Multiplication, Addition/Subtraction.

When operators of equal precedence are encountered side-by-side, they should be evaluated from left to right.

For example, let's evaluate the expression 2.5 + 5² * (4 + 3) / 2 using the above rules:

Step 1: Evaluate the expression within the brackets first: 4 + 3 = 7
2.5 + 5² * 7 / 2
Step 2: Evaluate the exponentiation: 5² = 25
2.5 + 25 * 7 / 2
Step 3: Evaluate the multiplication: 25 * 7 = 175
2.5 + 175 / 2
Step 4: Evaluate the division: 175 / 2 = 87.5
2.5 + 87.5
Step 5: Evaluate the addition: 2.5 + 87.5 = 90

So, the expression 2.5 + 5² * (4 + 3) / 2 evaluates to 90.

It is also important to note that in square roots, the expression under the horizontal bar is equivalent to a set of implicit parentheses. For example, if the expression 5³ + 4 * 7 - 1/2 were under the square root sign, it would be interpreted as follows:
√(5³ + 4 * 7 - 1/2)

Another common oversight is when dealing with fractions. In typeset expressions, fractions have the numerator and denominator separated by a horizontal line. However, when transcribing fractions to a single line (such as on a calculator or online), implicit parentheses must be added around each numerator and denominator. For example, the expression (x + 5) / (x + 3) should be written as (x + 5) / (x + 3) to ensure the correct interpretation using the BEDMAS rule.

In logical expressions, different operators have different precedence. The precedence rule for logical expressions are as follows:

1. ¬ (negation)
2. ∧ (conjunction)
3. ∨ (disjunction)
4. → (implication)
5. ↔ (biconditional)

For example, ¬p ∧ q ∨ p ∧ ¬q ↔ T means ((¬p) ∧ q) ∨ (p ∧ (¬q)) ↔ T.