# Can you factor a difference of squares even when the constant isn't a perfect square?

I am doing some partial fraction decomposition and I came across this problem. Decompose $$\frac{x-3}{x^2-7}$$. How can this be done?

I was thinking that maybe you could do a difference of squares? But since 7 isn't a perfect square is this allowed? I looked all over the web and found nothing on this subject, every video and website talks about perfect squares, but what if they aren't perfect?

Following the pattern of perfect squares I can only assume the pattern is to do the following, in order to decompose: $$\frac{A}{x-\sqrt{7}}+\frac{B}{x+\sqrt{7}}$$

Is this correct?

• That's correct (with a $+$ instead of $\times$). Aug 21 '19 at 2:43
• As an added bonus, you don’t even need it to be a “difference” in order for difference of two squares to work — if I had $x^2 + 7 = x^2- (-7)$ I could simplify it to $(x-\sqrt{-7})(x + \sqrt{-7}) = (x- i \sqrt{7})(x+ i \sqrt{7})$, as a bit of a spoiler for when you eventually encounter complex numbers. In fact, the proof of the quadratic formula basically boils down to: completing the square, using difference of two squares, applying null factor law. It’s very general! Aug 21 '19 at 2:51

Yes, you can do it, provided you don't mind using irrational real numbers. That is, if $$a$$ is positive, then you have that $$x^2-a=(x-\sqrt a)(x+\sqrt a).$$

You could have nonreal and complex coefficient for A and B. They're just numbers! $$\frac{x-3}{x^2-7}=\frac{A}{x-\sqrt{7}}+\frac{B}{x+\sqrt{7}}$$

So by equality we have:

$$\frac{x-3}{x^2-7}=\frac{A(x+\sqrt{7})+B(x-\sqrt{7})}{(x+\sqrt{7})(x-\sqrt{7})}$$

S0: $$A+B=1 \; and \; (A-B)\sqrt{(7)}=-3$$

Finally :

$$A=\frac{\sqrt{7}-3}{2\sqrt{7}}$$ $$B=\frac{\sqrt{7}+3}{2\sqrt{7}}$$

and:

$$\frac{x-3}{x^2-7}=\frac{1}{2\sqrt{7}}\Bigg(\frac{\sqrt{7}-3}{x-\sqrt{7}}+\frac{\sqrt{7}+3}{x+\sqrt{7}}\Bigg)$$