Hello, magentarita!
The orbit of a planet about the Sun is an ellipse, with the Sun at one focus.
The aphelion of a planet is its greatest distance from the Sun
. . and the perihelion is the shortest distance.
The mean distance of a planet from the Sun
. . is the length of the semimajor axis of the orbit.
The mean distance of Mars from the Sun is 142 million miles.
If the perihelion of Mars is 128.5 million miles, what is the aphelion? Code:
* * *
*  *
*  *
*  *

*  13.5 *
B *       *   o    * A
* 142 O S 128.5 *

*  *
*  *
*  *
* * *
The sun is at $\displaystyle S.$
The center of the ellipse is $\displaystyle O.$
All measurements are in millions of miles.
The mean distance is 142
. . $\displaystyle OA = OB = 142$
The perihelion is 128.5
. . $\displaystyle SA = 128.5 \quad\Rightarrow\quad OS = 13.5$
The aphelion is: .$\displaystyle BS \:=\:BO + OS \:=\:142 + 13.5 \;=\;155.5$
Write an equation for the orbit of Mars about the Sun. I assume that the center of the ellipse is at the origin.
The equation of an ellipse is: .$\displaystyle \frac{x^2}{a^2} + \frac{y^2}{b^2} \:=\:1$
We have: .$\displaystyle a = 142,\;c = 13.5$
. . where: .$\displaystyle a^2 \:=\:b^2+c^2$
Hence: .$\displaystyle 142^2 \:=\:b^2 + 13.5^2\quad\Rightarrow\quad b^2 \:=\:19,\!981.75$
Therefore, the equation is: .$\displaystyle \frac{x^2}{20,\!164} + \frac{y^2}{19,\!981.75} \;=\;1$