What is the order of seaonal differencing in ARIMAX with covariate explantory variables? In what order does ARIMAX perform which differentiations and apply exogeneous inputs? Seaonality in data can be removed through normal differencing (ARIMA), seasonal differencing (SARIMA), and/or using exogeneous inputs of covariates, fourier series, dummy variables. I am wondering in which order the arima algorithm does the differencing, and how to find out.
Say I have lights on/off coming on and off at same time every day and I look at energy use for lights and the data is called y(t). 
My data is not stationary.
Therefore if the model is... A: ARIMA[2,1,0] - won't be a very good model as one difference does does not remove the seasonality well
coefs AR1 and AR2.
First, takes the difference: y_diff(t) = [y(t)-y(t-dt)]/dt
Then y_diff(t) = AR1 *y_diff(t-1) +AR2 *y_diff(t-2)
B: ARIMA(2,1,0)24. seasonal arima
Does this transform my observation into a seasonally differenced  y24(t) = y(t)-y(t-24)
Then do the normal differencing? y_diff_24(t) = [y24(t)-y24(t-dt)]/dt
And then apply the coefficients? 
y_(t)= AR1 *y_diff(t-1) +AR2 *y_diff(t-2) +SAR1 *y_diff_24(t-1) +SAR2 *y_diff_24(t-2)
C:  ARIMA(2,1,0)24. seasonal arima with an exogeneous input x(t)  of say same seasonal pattern (lag of 24 hours, but more nuanced)
y_(t)= AR1 *y_diff(t-1) +AR2 *y_diff(t-2) +SAR1 *y_diff_24(t-1) +SAR2 *y_diff_24(t-2) +Coef(x(t)
What order does this happen in? Is the exogenous applied first, and then the seasonal differencing? OR seasonal differencing first?
Have not been able to find a breakdown of these equations when all scenarios are together.
Thanks,
Mel
