Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factoring support for quadratics #50

Open
3 of 4 tasks
evykassirer opened this issue Dec 14, 2016 · 7 comments
Open
3 of 4 tasks

Factoring support for quadratics #50

evykassirer opened this issue Dec 14, 2016 · 7 comments

Comments

@evykassirer
Copy link
Contributor

evykassirer commented Dec 14, 2016

We don't have any factoring polynomial support yet, but that's our next big goal!

We want to make another top level module like simplifyExpression and solveEquation that factors an expression (note that factoring is sort of the opposite of simplifying, because simplifying distributes and we would want to "un-distribute")

We should be able to factor quadratics in the following ways:

  • note: we should also explain step by step how to solve it
  • note: feel free to only implement one of these in your pull request

  • sum/product rules
  • e.g. x^2+5x+6
  • Ask: Which two numbers add up to 5 and multiply to 6? Answer: 2 and 3
  • Final answer: (x+2)(x+3)

  • perfect square
  • e.g. x^2+2x+1
  • rewrite in the form a^2 + 2b + b^2 where a = x and b = 1
  • use "square of sum rule" (a+b)^2 = a^2 + 2ab + b^2 to factor into (x+1)^2

  • quadratic equation
  • your favourite: x = [-b +or- sqrt(b^2 - 4ac) ] / 2a

  • export factoring in the mathsteps module
@sangwinc
Copy link

sangwinc commented Jan 23, 2017

Perhaps you might like to also consider "completing the square" as a method for solving quadratics?

x^2+2*a*x +c = 0,
x*(x+2*a) +c = 0, 
(x+a-a)*(x+a+a)+c = 0, 
(x+a)^2-a^2+c = 0
(x+a)^2 = a^2-c

... etc.

I've only just come across your system (and I'm impressed: email to follow).

Does your system provide more than one solution, or does it always just give "the way" to solve an equation?

@evykassirer
Copy link
Contributor Author

evykassirer commented Jan 23, 2017

as far as I remember, completing the square tends to be used for graphing, and isn't as useful for factoring (which is what this particular issue is working on, and would be used for simplifyExpression and solveEquation)

I could totally see another function alongside solveEquation that completes the square for quadratics and/or gives steps for graphing a function. Feel free to open an issue for that if you'd like to see it be worked on :)

Right now we always give one solution, but in the future it might be possible to configure certain settings to get certain kinds of solutions.

@evykassirer
Copy link
Contributor Author

unassigned, since the initial pull request went through

we still need to add quadratic equation, and also expose factoring to users of the mathsteps module

@aelnaiem
Copy link
Collaborator

Thanks for updating this! I will probably pick up exposing factoring in the API. Should it just be around factor() or should it be factorQuadratic? Also, factoring is often one step (currently it always is but it will have more steps once we support the quadratic equation). Finally, should we support factoring for equations as well? In the case that it's x^2 + 3x + 2 = 0, we actually have two results (similar to absolutes), x = -1 and x = -2. So maybe we wait until we have multiple case support before we tackle that?

@hmaurer
Copy link
Contributor

hmaurer commented Feb 23, 2017

note that factoring is sort of the opposite of simplifying, because simplifying distributes and we would want to "un-distribute"

I am inclined to disagree with that. Take Mathematica as an example, they have two functions: "Expand" and "Factor". "Expand" behaves like simplifyExpression, and "Factor" is an advanced version of what is being discussed in this issue. However the goal of simplifyExpression is not (or is it?) to expand, it is to simplify, aka to make it as clear as possible to the student.

With that in mind, factorisation could very well be used in the simplification process. For example, one might argue that 2x + 2y is a more complex expression than 2 * (x + y). Likewise, x^2 + y^2 + 2*x*y is certainly more complex than (x + y)^2. It is harder to reader, harder to find the roots of, etc. Now of course this depends on how we define "expression complexity", what the student's goal is, etc. The simplification process might also need to start by expanding an expression, cancel out terms, then factor it back to a nice result. This might be particularly

@evykassirer
Copy link
Contributor Author

evykassirer commented Feb 24, 2017

I think your message got cut off

that's a good point! it's hard to know what form a student is looking for, but adding factoring at the end is definitely something we can consider doing, or adding as an option parameter or something

@aelnaiem
Copy link
Collaborator

There's a new pull request for exposing factoring
#148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants