Consider the following Heat Equation $$u_{xx} = \pi^2 u_t,\ u(0,\ t) = 10,\ u(3,\ t) = 22,\ u(x,\ 0) = 4x + 17$$
I want to solve this via separation of variables, which will require finding the steady-state solution, and the remainder of the solution. Since both of these parts will want to utilize a lot of the same letters, I will use color to indicate namespaces while avoiding subscript hell, so I will have $u(x,\ t) = \color{#CE2029}{u(x,\ t)} + \color{#0048BA}{u(x)}$, where $\color{#0048BA}{u(x)}$ is the steady-state solution and $\color{#CE2029}{u(x,\ t)}$ is the remainder of the solution, and all constants, variables, and functions will similarly be colored blue if they are associated with the steady-state solution and red if they are associated with the remainder.
Starting with the steady-state solution, I have $\color{#0048BA}{u_{xx} = 0,\ u(0) = 10,\ u(3) = 22}$. The general solution is $\color{#0048BA}{u = Ax + B}$, and plugging in the initial conditions I get that $\color{#0048BA}{A = 4}$ and $\color{#0048BA}{B = 10}$, yielding the particular solution $\color{#0048BA}{u = 4x + 10}$.
Subtracting this steady-state problem from the original problem, the remaining problem is $\color{#CE2029}{u_{xx} = \pi^2 u_t,\ u(0,\ t) = 0,\ u(3,\ t) = 0,\ u(x,\ 0) = 7}$. Plugging in the separated form $\color{#CE2029}{u = X(x)T(t)}$ leads to the general solution $\color{#CE2029}{u = Ae^{\lambda t}(Be^{-\pi \sqrt\lambda x} + Ce^{\pi \sqrt\lambda x})}$. If I absorb $\color{#CE2029}A$ into $\color{#CE2029}B$ and $\color{#CE2029}C$, then plug in the boundary conditions, I get $\color{#CE2029}{C = -B}$ and $\color{#CE2029}{\lambda = -\frac{n^2}{9}}$, and thus the solution $\color{#CE2029}{u = e^{-\frac{n^2 t}{9}}(Be^{-\frac{n\pi xi}{3}} - Be^{\frac{n\pi xi}{3}})}$. Applying Euler's formula and lumping constants again yields $\color{#CE2029}{u = Be^{-\frac{n^2 t}{9}}\sin(\frac{n\pi x}{3})}$.
Summing all of the solutions produces $\color{#CE2029}{u = \sum_{n = 0}^\infty Be^{-\frac{n^2 t}{9}}\sin(\frac{n\pi x}{3})}$. For the initial condition, the Fourier Series coefficient $\color{#CE2029}B$ is given by $\color{#CE2029}{B = \frac{2}{3}\int_0^3 7\sin(\frac{n\pi x}{3})\ dx}$, which comes out to $\color{#CE2029}{B = \frac{14(-1)^{n + 1} + 14}{n\pi}}$, yielding the particular solution $\color{#CE2029}{u = \sum_{n = 1}^\infty \frac{(14(-1)^{n + 1} + 14)\sin(\frac{n\pi x}{3})}{n\pi e^{\frac{n^2 t}{9}}}}$.
The total solution is the sum of these two parts $$u(x,\ t) = \color{#0048BA}{4x + 10} + \color{#CE2029}{\sum_{n = 1}^\infty \frac{(14(-1)^{n + 1} + 14)\sin(\frac{n\pi x}{3})}{n\pi e^{\frac{n^2 t}{9}}}}$$
Is this solution/process correct?
Edit in response to comment: My understanding is that one of the major themes of the Heat Equation is that it makes discontinuities between boundary conditions and initial conditions disappear instantly, and that the same solution process will work with or without such discontinuities. My source was this lecture.