I'll take my own advice and "Try this answer to Synodic Day and Sidereal Day and see what happens.
As explained there, what we do in this case is subtract frequencies, just like radios heterodyne one frequency with another close by to downconvert.
$$f_{\text{diff}} = f_> - f_<$$
where the > and < indicate the larger and smaller frequencies.
The frequency of the Earth's orbit is very low, and subtracts from the Earth's natural 23h 56m 4.09s rotational frequency to give us a 24 hour day.
To convert a period into a frequency, we take the reciprocal, so it's:
$$\frac{1}{T_{syn}} \ = \ \frac{1}{T_<} - \frac{1}{T_>} \ = \ \frac{T_> - T_<}{T_> \ T_<}.$$
In this case the year will be the synodic period $T_{syn}$, and the sidereal period will be $T_<$, and we'll solve for the slightly longer, larger period solar day $T_>$.
$$\frac{1}{T_{solar}} \ = \ \frac{1}{T_{sid}} - \frac{1}{T_{year}} \ = \ \frac{T_{year} - T_{sid}}{T_{year} \ T_{sid}}.$$
sidereal day: 23 * 3600 + 56 * 60 + 4.09 = 86164.09 sec
one year: 365.2564 * 24 * 3600 = 31558152.96 sec
yields for the solar day: 86399.99 sec compare to 86400 = 24 * 3600 sec