Let's look at the second degree equation
$$y''+Py'+Qy=F(x) \tag{1}$$
where $P = P(x)$ and $Q = Q(x)$. Suppose we know the complementary solution to the ODE is
$$y = A u(x) + B v(x) \tag{2}$$
and now assume $A = A(x)$ and $B = B(x)$ are unknown functions to be determined, so that $y$ is a solution to the original ODE (Legendre's idea). We start our first differentiation
$$y' = A'u\left( x \right) + B'v\left( x \right) + Au'\left( x \right) + Bv'\left( x \right) \tag{3}$$
We assume our first equation:
$$A'u\left( x \right) + B'v\left( x \right)=0 \tag{4}$$
so from (3)
$$\begin{align*} y' &= Au'\left( x \right) + Bv'\left( x \right) \\
y'' &= Au''\left( x \right) + Bv''\left( x \right) + A'u'\left( x \right) + B'v'\left( x \right)\end{align*}\tag{5}$$
and replacing (5) to (1)
$$Au''\left( x \right) + Bv''\left( x \right) + A'u'\left( x \right) + B'v'\left( x \right) + P\left( {Au'\left( x \right) + Bv'\left( x \right)} \right) + Q\left( {Au\left( x \right) + Bv\left( x \right)} \right) = F(x).$$
Since $y$ is solution to the homogeneous equation, we have that
$$Au''\left( x \right) + Bv''\left( x \right) + P\left( {Au'\left( x \right) + Bv'\left( x \right)} \right) + Q\left( {Au\left( x \right) + Bv\left( x \right)} \right) = 0 \tag{7}$$
so giving the first equation to the system
$$\begin{align*}
A'u'\left( x \right) + B'v'\left( x \right) &= F(x) \cr
A'u\left( x \right) + B'v\left( x \right) &= 0 \end{align*}. \tag{8}$$
From algebra we have that this system is solved in terms of the determinants, which give
$$\eqalign{
& A' = \frac{{ - vF}}{{uv' - u'v}} \cr
& B' = \frac{{uF}}{{uv' - u'v}} \cr} $$
Recalling the Wronskian Determinant of $u$ and $v$ is $W(u,v) = uv'-u'v$ we can write this as
$$\eqalign{
& A' = \frac{{ - vF}}{{W\left( {u,v} \right)}} \cr
& B' = \frac{{uF}}{{W\left( {u,v} \right)}} \cr} $$
Which upon integration give
$$\eqalign{
& A = - \int {\frac{{vF}}{{W\left( {u,v} \right)}}} dx +C_1 \cr
& B = \int {\frac{{uF}}{{W\left( {u,v} \right)}}} dx +C_2 \cr} $$
and make our solution be
$$y = v\left( x \right)\int {\frac{{uF}}{{W\left( {u,v} \right)}}} dx - u\left( x \right)\int {\frac{{vF}}{{W\left( {u,v} \right)}}} dx + C_1v\left( x \right) - {C_2}u\left( x \right)$$
I like to write this succintly as
$$y = v\int {\frac{{u \cdot F}}{W}} dx - u\int {\frac{{v \cdot F}}{W}} dx + C_1v - C_2u$$
Note that $C_1v - C_2u$ is the original solution to the homogeneous equation we had found.