I want to make sure that I have done it right.
First of all, I going to show how I think the state space representation whould look like:
The System: $$\dot{x} = Ax + Bu + I_dd$$ $$ y = Cx + I_n n$$
Where $I_n$ is the identity matrix for the noise and $I_d$ is the identity matrix for the disturbance. For SISO system $I_n = 1$
The LQE: $$\dot{\hat{x}} = A\hat{x} + Bu + Ke$$ $$\hat{y} = C\hat{x}$$ $$e = y - \hat{y} = Cx + I_n n - C\hat{x}$$
The LQR: $$ u = -L\hat{x} + L_i x_i$$
The LQI: $$ \boxed{\dot{x_i} = I_r r - y = I_r r - Cx - I_n n}$$ $$ x_i = \int_{0}^{t} (I_r r- y)dt = \int_{0}^{t} (I_r r - Cx - I_n n)dt = \int_{0}^{t} = \dot{x_i} dt$$
Where $I_r$ is the identity matrix for the reference signal. For SISO system $I_r = 1$
Assume that: $$\tilde{x} = x - \hat{x} \rightarrow \tilde{x} - x = - \hat{x} $$
Inserting that in LQR results the new $u$: $$u = -L\hat{x} + L_i x_i \rightarrow L\tilde{x} - Lx + L_i x_i$$
Inserting the new $u$ in System results: $$\dot{x} = Ax + B(L\tilde{x} - Lx + L_i x_i) + I_dd$$ $$\dot{x} = Ax + B L\tilde{x} - BLx + B L_i x_i + I_dd$$ $$\boxed{\dot{x} = (A- BL)x + B L\tilde{x} + B L_i x_i + I_dd}$$
Inserting new $u$ and $e$ in LQE results: $$\dot{\hat{x}} = A\hat{x} + B(L\tilde{x} - Lx + L_i x_i) + K(Cx + I_n n - C\hat{x})$$ $$\dot{\hat{x}} = A\hat{x} + B L\tilde{x} - B Lx + B L_i x_i + K Cx + KI_n n - K C\hat{x}$$ Assume that: $$\dot{\tilde{x}} = \dot{x} - \dot{\hat{x}}$$
That means: $$\dot{\tilde{x}} = [Ax + B L\tilde{x} - BLx + B L_i x_i + I_dd] - [A\hat{x} + B L\tilde{x} - B Lx + B L_i x_i + K Cx + KI_n n - K C\hat{x}]$$ $$\dot{\tilde{x}} = Ax + B L\tilde{x} - BLx + B L_i x_i + I_dd - A\hat{x} - B L\tilde{x} + B Lx - B L_i x_i - K Cx - KI_n n + K C\hat{x}$$ $$\dot{\tilde{x}} = Ax + I_dd - A\hat{x} - K Cx - KI_n n + K C\hat{x}$$
But remember that: $$\tilde{x} = x - \hat{x}$$
Will give us: $$\dot{\tilde{x}} = Ax + I_dd - A\hat{x} - K Cx - KI_n n + K C\hat{x}$$ $$\dot{\tilde{x}} = A(x - \hat{x}) + I_dd - KC(x -\hat{x}) - KI_n n$$ $$\dot{\tilde{x}} = A\tilde{x} + I_dd - KC\tilde{x} - KI_n n$$ $$\boxed{\dot{\tilde{x}} = (A - KC)\tilde{x} + I_dd - KI_n n}$$
Result: The whole state space representation will be:
$$\begin{bmatrix} \dot{x}\\ \dot{\tilde{x}}\\ \dot{x_i} \end{bmatrix} = \begin{bmatrix} A-BL & BL & BL_i \\ 0 & A-KC & 0\\ -C & 0 & 0 \end{bmatrix} \begin{bmatrix} x\\ \tilde{x}\\ x_i \end{bmatrix}+\begin{bmatrix} 0 & I_d & 0\\ 0 & I_d & -K I_n\\ I_r & 0 & -I_n \end{bmatrix}\begin{bmatrix} r\\ d\\ n \end{bmatrix}$$
$$y = \begin{bmatrix} C & 0 & 0 \end{bmatrix}\begin{bmatrix} x\\ \tilde{x}\\ x_i \end{bmatrix} +\begin{bmatrix} 0 & 0 & I_n \end{bmatrix}\begin{bmatrix} r\\ d\\ n \end{bmatrix}$$
Questions:
- Am I wrong or Am I right? Is this the Linear Quadratic Gaussian Integral regulator?
- Is there any way to compute the integral gain matrix $L_i$ by using Algebratic Riccati Equation (ARE)?
- Will this regulator remove the steady state error?
- What is the transfer function for this state space?
Source: https://github.com/DanielMartensson/Mataveid/ https://github.com/DanielMartensson/Matavecontrol

Due to certainty equivalence you can split the observer and feedback control up into two separate problems. So the full state observer can indeed be found using a Kalman filter/LQE. For the control LQI can be used, which tries to minimize
$$ J(u) = \int_0^\infty \left[z^\top(t)\,Q\,z(t) + u^\top(t)\,R\,u(t) + 2\,z^\top(t)\,S\,u(t)\right] dt, \tag{1} $$
with $z(t) = \begin{bmatrix}x^\top(t) & x_i^\top(t)\end{bmatrix}^\top$ and $x_i(t)=\int (r-y)dt$. So using the standard state space model (without the feed through matrix $D$) and augmenting the state space yields
$$ \begin{bmatrix} \dot{x} \\ \dot{x}_i \end{bmatrix} = \begin{bmatrix} A & 0 \\ -C & 0 \end{bmatrix} \begin{bmatrix} x \\ x_i \end{bmatrix} + \begin{bmatrix} B \\ 0 \end{bmatrix} u. \tag{2} $$
The combined optimization problem using $(1)$ and $(2)$ can just be solved with LQR. However I am not entirely sure myself why your are allows to disregard the reference input from $(2)$.