This paper proposes a governing equation for stock market indexes that accounts for non-stationary effects. This is a linear Fokker-Planck equation (FPE) that describes the time evolution of the probability distribution function (PDF) of the price return. By applying Ito's lemma, this FPE is associated with a stochastic differential equation (SDE) that models the time evolution of the price return in a fashion different from the classical Black-Scholes equation. Both FPE and SDE equations account for a deterministic part or trend, and a stationary, stochastic part as a q-Gaussian noise. The model is validated using the S\&P500 index's data. After removing the trend from the index, we show that the detrended part is stationary by evaluating the Hurst exponent of the multifractal time series, its power spectrum, and its autocorrelation.