a = x mod n

Where x would be the result from a % n.

]]>5 % 2 = 1

10 % 3 = 1

100 % 10 = 0

5 % 5 = 0

22 % 4 = 2

If you wish to see whether n goes into a (n divides a), you would do:

if (a % n == 0)

]]> Declare a variable n and then make an iterative loop where n starts at the smaller value of the two numbers in question. For each iteration is would decrease by 1. Then declare a variable f1 (greatest common denominator)

In the loop make a statement so that if;

a%n = a/n and d%n = d/n then f1 = n

]]>ac = n

d + e = b

d = n / e

d = ac / e

b = ac / e + e

b = (ac + e²) / e

be = ac + e²

e² - be + ac = 0

e = (b ± √(b² - 4ac)) / 2a

The two solutions for e actually represent both factors i.e., d and e

This definition will lead you to;

ax² + dx + ex + c

But now you would need to factorize;

ax² + dx and also ex + c

I'll have to think about this one some more.

edit*

It seems that after you had a, d, e, and c, you would then need an expression which would find the greatest common factor of a and d and then the gcf of e and c.

If f1 were the greatest factor of a and d and f2 were the gfc of e and c;

Your solution would be;

(f1 + f2) (a/f1 + d/f1)

If (a/f1 + d/f1) ≠ (e/f2 + c/f2), then it is not factorizable.... I think.

I have to leave this for someone smarter than me from this point. Sorry I couldn't be more helpful.

]]>for(i=0; i<255; i++){

for(j=0; j<255; j++){

while(a*c==i*j & b==i+j){ cout << "(x + " << i << ")(x + " << j) };

}

}

a, b and c are doubles entered by the user, how do I expand this program to take in values of a (ax^2 + bx + c) that are not 1 and then display the co-efficients of x in the answer?

]]>I wouldn't bother trying to get that negative sign out of this problem, as you can see, it only served to confuse you. Mathsyperson's detailed description is all that you need.

-2x² - 7x + 15 (you realized that -10 and +3 were the factors needed)

-2x² - 10x + 3x + 15

-2x(x + 5) + 3(x + 5)

(x + 5)(-2x + 3)

I am actually thrilled to be able to do this myself. I hadn't seen, or did not remember, this method until Mathsyperson layed the steps out perfectly.

]]>(-2x + 3)(x + 5) or (2x - 3)(-x - 5)

]]>so

-2x^2 - 7x + 15

-[2x^2 + 7x - 15]

-[(2x - 3)(x + 5)]

my problem is removing the square set of brackets here.]]>

x = 0 => y = 15

-2x^2 - 7x + 15

-[2x^2 + 7x - 15]

Here, I can see that the two numbers I need are +10 and -3 since:

10 * -3 = 2 * -15

and

10 - 3 = 7

so would the answer be...

Let's do it with your one.

6x² - 11x + 3 = 0

The way to solve this is similar to solving ones where the x² coefficient is 1, but instead of finding 2 numbers that add to give -11 and multiply to give 3, we need numbers that add to give -11 and multiply to give 6x3 = 18, because the x² coefficient is 6.

Two such numbers are -9 and -2.

We can use these numbers to rewrite the original equation in a different form:

6x² - 9x - 2x + 3 = 0

Factorising the first two terms gives: 3x(2x - 3) - 2x + 3 = 0

Factorising the last two terms gives: 3x(2x - 3) -1(2x - 3) = 0 [1 included for clarity]

These two terms will combine to give (2x-3)(3x-1) = 0

The two x coefficients will always factorise with the other 2 terms to make the overall factorisation easier, no matter what coefficients you start off with. (Provided, of course, that they factorise in the first place)

If you're doing A level, you probably know this already, but you can check if a quadratic will factorise by looking at the discriminant: b² - 4ac, where a, b and c come from ax² + bx + c = 0.

For the quadratic to factorise, the discriminant has to be a square number.

]]>