First gain familiarity with the actual solution.
From xy' − 4y = ex, go to y' − (4/x)y = ex/x, which is in the form of a linear first-order equation or
dy/dx + P(x)y = Q(x).
For y' − (4/x)y = ex/x, obtain an integrating factor by writing e∫(-4/x)dx equal to e-4ln |x| or |x|-4 or 1/x4.
Now build the "primitive" solution as y(1/x4) = ∫(1/x4)(ex/x)dx + C1; multiply through this last by x4 and write y = x4∫(1/x4)(ex/x)dx + C1x4.
Then isolate ∫(1/x4)(ex/x)dx. A tremendous integration by parts expresses the solution to this integral as Ei(x)/24 − (x3 + x2 + 2x + 6)ex/24x4 + C2.
{Note that Ei(x) above stands for "Exponential Integral with respect to x" and is equal to ∫(ex/x)dx which translates via Maclaurin's Series to ln |x| + x1/1(1!) + x2/2(2!) + x3/3(3!) + ... + C3.}
Now develop y = x4∫(1/x4)(ex/x)dx + C1x4 as: y = x4{Ei(x)/24 − (x3 + x2 + 2x + 6)ex/24x4 + C2} +C1x4.
Next, y = x4Ei(x)/24 − [(x3 + x2 + 2x + 6)ex/24 +C2x4] + C1x4.
Then, y = x4Ei(x)/24 − x3ex/24 − x2ex/24 − 2xex/24 − 6ex/24 + (C1 + C2)x4.
Final simplification gives y = Cx4 + x4Ei(x)/24 − x3ex/24 − x2ex/24 − xex/12 − ex/4.