The product
[beautiful math coming... please be patient]
$\,(-a)b\,$ can be written in a variety of ways:
[beautiful math coming... please be patient]
$$
\overset{\text{the opposite of $\,a\,$, times $\,b\,$}}{\overbrace{(-a)b}}
=
\overset{\text{$a\,$, times the opposite of $\,b$}}{\overbrace{a(-b)}}
=
\overset{\text{the opposite of $\,ab$}}{\overbrace{-ab}}
$$
In all these cases,
the same three numbers are being multiplied
(
[beautiful math coming... please be patient]
$\,-1\,$, $\,a\,$, and $\,b\,$),
so the result is the same.
People have different preferences as to how much or how little they use parentheses,
and how much or how little they use the centered dot to denote multiplication.
There are places where parentheses and centered dots are needed,
but in other situations they're optional.
I suppose that you might see any of these: $$ ab \ =\ (a)b \ =\ a(b) \ =\ (a)(b) \ =\ a\cdot b \ =\ a\cdot(b) \ =\ (a)\cdot b \ =\ (a)\cdot (b) $$ In this case, the simplest (and strongly preferred) representation is just $\,ab\,$.
When two variables are juxtaposed (i.e., sitting next to each other),
as in the expression $\,ab\,$,
the operation between them is multiplication.
Thus, $\,ab\,$ is the simplest (and preferred) way to denote $\,a\,$
multiplied by $\,b\,$.
When a signed variable is involved, parentheses are usually required.
To multiply $\,a\,$ by $\,-b\,$ (in that order)
we can't just juxtapose them and write $\,a -b\,$,
because this would look like subtraction.
Thus, we must write $\,a(-b)\,$.
When you see opposites in multiplication problems,
just treat the minus sign as a factor of $\,-1\,$, and recall these rules:
Any even number of factors of $\,-1\,$ is positive:
for example, $\,(-1)(-1)(-1)(-1) = 1\,$.
Any odd number of factors of $\,-1\,$ is negative:
for example, $\,(-1)(-1)(-1) = -1\,$.
Conventionally, the minus sign (if there is one) is pulled to the front of the expression,
as illustrated in these examples:
$\,(-a)(-b) = ab\,$ | (two factors of $\,-1\,$) |
$\,-(-a)(b) = ab\,$ | (two factors of $\,-1\,$) |
$\,-a(-b) = ab\,$ | (two factors of $\,-1\,$) |
$\,-(-a)(-b) = -ab\,$ | (three factors of $\,-1\,$) |
$\,(-a)(-b)(-c)(d) = -abcd\,$ | (three factors of $\,-1\,$) |