Composition and division notation for functions To provide context:
In Spivak's Calculus, Chapter 10's Problem 19a reads as follows:

If $f$ is three times differentiable and $f'(x)\neq 0$, the Schwarzian derivative of $f$ at $x$ is defined to be $$\mathscr Df(x)=\frac{f'''(x)}{f'(x)}-\frac{3}{2}\left(\frac{f''(x)}{f'(x)}\right)^2$$ Show that $\mathscr D(f\circ g)=[\mathscr Df\circ g]\cdot g'^{\ 2}+\mathscr Dg$

The final portion of the solution (provided by an official answer book) reads as follows:
\begin{align}
\cdots &= \frac{(f''' \circ g)g'^{\ 2}}{f'\circ g}+ \frac{3(f'' \circ g)g''}{f'\circ g}+ \frac{g'''}{g'}- \frac{3}{2}\left(\frac{(f'' \circ g)\cdot g'}{f' \circ g}\right)^2-3 \frac{(f''\circ g)g''}{f' \circ g}- \frac{3}{2}\left(\frac{g''}{g'}\right) \\
&=\left[\frac{f'''}{f'}\circ g - \frac{3}{2}\frac{f'' \circ g}{f' \circ g} \right]\cdot g'^{\ 2}+\frac{g'''}{g'} - \frac{3}{2}\left (\frac{g''}{g'}\right)^2
\end{align}
My question in particular is about the author's choice to express the fractions $\frac{f'''}{f'}\circ g$ and $- \frac{3}{2}\frac{f'' \circ g}{f' \circ g}$ in the depicted manner.
I'm not overly familiar with this style of abridged notation, but, generally speaking, I think I can infer their meaning.
Is it safe to assume that $\frac{f'''}{f'}\circ g$ is semantically equivalent to the expression $\frac{f''' \circ g}{f' \circ g}$? In which case, $-\frac{3}{2}\frac{f'' \circ g}{f' \circ g}$ is semantically equivalent to $-\frac{3}{2}\frac{f''}{f'}\circ g$?
If this is true, can I chop up the author's choice to express these terms differently (i.e. one is in a form where "$\circ g$" is not included in the fraction whereas in the other form, "$\circ g$" is included in the fraction) as unintentional (due to its irrelevance)?
Edit: I realized there is a typo in Spivak's solution. Specifically, the $-\frac{3}{2}\frac{f'' \circ g}{f' \circ g}$ should actually be:
$$-\frac{3}{2}\left(\frac{f'' \circ g}{f' \circ g}\right)^2$$
The original question still remains.
 A: In general, given two functions $f,g:A\to\Bbb{R}$ where $A$ is any set, the notation $fg$ means the function $A\to\Bbb{R}$ such that for every $x\in A$, $(fg)(x):= f(x)\cdot g(x)$. So, we are defining the symbol $fg$ to be a function which is defined by pointwise multiplication.
Similarly, if $f,g:A\to\Bbb{R}$ are functions and $g$ is nowhere vanishing (i.e for each $x\in A$, $g(x)\neq 0$), then we can define the quotient function $\frac{f}{g}:A\to\Bbb{R}$ as for each $x\in A$, $\left(\frac{f}{g}\right)(x):=\frac{f(x)}{g(x)}$. Once again, the quotient is defined pointwise.
Also, given a real number $c\in\Bbb{R}$ and a function $f:A\to\Bbb{R}$, by the symbol $cf$ one means the function $A\to\Bbb{R}$ such that for each $x\in A$, $(cf)(x):= c\cdot f(x)$.
Finally, for composition, assuming $A:A\to B$ and $f:B\to C$ are functions, by the symbol $f\circ g$, we mean the function $A\to C$ such that for each $x\in A$, $(f\circ g)(a):=f(g(a))$.
Now, a-priori, we should always use brackets to denote what we mean, so a-priori, the following could all mean different things

*

*$\left[-\frac{3}{2}\left(\frac{f''}{f'}\right)\right]\circ g$

*$-\frac{3}{2}\left[\left(\frac{f''}{f'}\right)\circ g\right]$

*$-\frac{3}{2}\left(\frac{f''\circ g}{f'\circ g}\right)$
But, a moment's consideration with the above definitions will show that these are all the same function, because for each $x\in\text{domain}(g)$, the value of these functions at the point $x$ is simply the real number
\begin{align}
-\frac{3}{2}\cdot \frac{f''(g(x))}{f'(g(x))}.
\end{align}
With some practice with the definitions, one gets comfortable with manipulating functions as easily as one manipulates real numbers, so it becomes immediately apparent that all these things are equal.

In the last equality, you write
\begin{align}
\cdots
&=\left[\frac{f'''}{f'}\circ g - \frac{3}{2}\left(\frac{f'' \circ g}{f' \circ g}\right)^2 \right]\cdot g'^{\ 2}+\frac{g'''}{g'} - \frac{3}{2}\left (\frac{g''}{g'}\right)^2
\end{align}
To really complete the proof, I would "simplify" it as follows
\begin{align}
\cdots &=\left[\frac{f'''}{f'}\circ g - \frac{3}{2}\left(\frac{f''}{f'} \right)^2\circ g\right]\cdot g'^{\ 2}+\left[\frac{g'''}{g'} - \frac{3}{2}\left (\frac{g''}{g'}\right)^2\right]\\
&= \left(\left[\frac{f'''}{f'} - \frac{3}{2}\left(\frac{f''}{f'} \right)^2\right]\circ g \right)\cdot g'^{\ 2}+\left[\frac{g'''}{g'} - \frac{3}{2}\left (\frac{g''}{g'}\right)^2\right]\\
&= \left([\mathcal{D} f]\circ g\right)\cdot (g')^2 + \mathcal{D}g
\end{align}
As you can see, in the first few steps of applying the chain rule, it is convenient to keep the composition with $g$ in the fractions itself, but towards the end of the solution, when you want to re-condense everything in terms of the Schwarzian derivative, it is convenient to pull the $\circ g$ out, so that we can write it correctly as $(\mathcal{D}f)\circ g$.
