I recently learnt Ostrogradsky's Method for integration by watching this video. I noticed that in the questions I did, whenever the denominators $Q_1$ and $Q_2$ were equal and were of degree $2$, the coefficient of the linear term in the numerator of the integral (i.e. coefficient of $x$ term in $P_2$) was $0$.
Is this simply a coincidence or does it always occur? I tried to prove this or disprove using general variables but there were too many variables to handle.
This is false whenever $P$ is a cubic. In Ostrogradsky's method, we have $$\int\frac PQ=\frac{P_1}{Q_1}+\int\frac{P_2}{Q_2}\tag1$$ under the conditions that
$P,Q$ are polynomials with real coefficients, $P/Q$ is proper and $Q$ has multiple roots
$Q_1=\gcd(Q,Q')$ and $Q_2=Q/Q_1$
$\deg P_1<\deg Q_1$ and $\deg P_2<\deg Q_2$.
In your example, you specify that $Q_1=Q_2$ is a quadratic. Condition 2. implies that $Q=Q_1^2$ is a quartic, and thus $\deg P\le 3$ from condition 1. Differentiating $(1)$ yields $$\frac P{Q_1^2}=\frac{P_1'Q_1-P_1Q_1'}{Q_1^2}+\frac{P_2}{Q_1}\implies P=\underbrace{P_1'Q_1-P_1Q_1'}_{\deg=2}+P_2Q_1\tag2.$$ Equating like terms of $(2)$ gives $$\text{cubic term of}\,P=\text{linear term of}\,P_2\times\text{quadratic term of}\,Q_1.$$ Therefore, if the linear term of $P_2$ is zero, the cubic term of $P$ must be zero, forcing $P$ to be a quadratic.