Source : Olry Terquem, Exercices de mathématiques élémentaires , $1842$
( At Archive.org https://archive.org/details/exercicesdemath00terqgoog/page/n85/mode/1up)
I'm working on problem $35$ below, where appears also the solution.
My question is simply : is this solution correct, as far as the denominator is concerned?
When I do $(a-x)^2(a+x)^2(a-x)$, I get
$ (a-x)(a-x)(a+x)(a+x)(a-x) $
$= (a-x)(a+x)(a-x)(a+x)(a-x)$
$= [(a-x)(a+x)] [(a-x)(a+x)](a-x)$
$= (a^2- x^2) ^2 (a-x)$.
Or, am I wrong?

Your calculations are correct, but you slip up when it comes to what you actually do to the denominator to add fractions.
Specifically, when you multiply each addand fraction by a form of $1$ to get get a common denominator, that denominator is not (necessarily) the product of the individual denominators, but their least common multiple.
That noted, it should be clear that
$${\rm lcm}((a-x)^2,(a+x)^2,a-x)=(a-x)^2(a+x)^2=(a^2-x^2)^2$$