# Factoring two variable function

1. May 7, 2016

### terryds

1. The problem statement, all variables and given/known data

How to factor 2x^2 - (p-2)x - p ??

2. Relevant equations
Basic factoring

3. The attempt at a solution

I don't know how to do it.

2. May 8, 2016

### blue_leaf77

By finding its roots?

3. May 8, 2016

### terryds

It seems pretty complicated

4. May 8, 2016

### blue_leaf77

Yes.
It's very easy, you just need to pick that pen of yours and work it out on a paper.

5. May 8, 2016

### haruspex

As Blue Leaf posted, that will certainly work, but there is often an easier way. Assuming it has reasonable factors, you can factorise the first and last coefficients. This yields the only possibilities as (x ....)(2x...) and (... 1)(... p). There are two ways of merging those, and some number of options for the sign in between.

6. May 8, 2016

### terryds

Aha!

2x^2 + 2x - px - p= 0
2x (x+1) - p (x+1) =0
(2x-p)(x+1)=0

Thanks a lot! :D

7. May 8, 2016

8. May 8, 2016

### SammyS

Staff Emeritus
Looks as if it's all solved very nicely.

Rather than considering this as a two variable function, I would consider p to be a parameter and x to be a variable, the independent variable. So $\ 2x^2 - (p-2)x - p \$ is a quadratic (degree 2 polynomial) in $\ x\ .$

They way you factored this expression is very sensible.
Expanding the middle term gives a polynomial with 4 terms. A classic method for factoring a 4 term polynomial is called factoring by grouping, which is what you did.

In your case you might consider it to be good fortune that, you were given a quadratic in x, which could be expressed as a factorable 4 term polynomial.

The suggestion of blue_leaf77 in post #2, was also good advice. Whatever the method of finding the two zeros (roots to $\ ax^2+bx+c=0\$), if those two zeros are $\ s_1\$ and $\ s_2 \$, then the polynomial factors as follows.
$ax^2+bx+c = a(x-s_1)(x-s_2)$​

.Notice that the roots to you final equation in post #6 are x = p/2, -1 .

This gives the factoring you gave in post #1.
$2x^2 - (p-2)x - p = 2(x - p/2)(x +1)$​