0

I'm looking for a javascript or php-script that is able to solve a system of equations with one unknown variable x. The equation can be of any kind, i.e. linear, quadratic, cubic etc. e.g. 10-2*x = 25*x or 12*sin(x³) = ln(x²) or e^x² = x^5

I hope I've explained you well enough what I'm looking for. Do you think that such scripts exist or are there maybe other possibilities to calculate such equations?

Thanks in advance.

Cheers,

enne

Reporter
  • 3,897
  • 5
  • 33
  • 47
enne87
  • 2,221
  • 8
  • 32
  • 61

1 Answers1

1

There is no way to solve any equation automatically. Even if you need to get only numerical solution.

Of course, there are several well known methods to get approximate results. But each of them imposes some restrictions to the equation.

Here is a simple script that implements Newtons method.

eugene_che
  • 1,997
  • 12
  • 12
  • First of all, thanks for your reply. So one method is to take the left and the right part of the equation and iteratively insert a number. As soon as both results are nearly the same, a result for x is found. Can you please tell me why this approach underlies restrictions, too? – enne87 Aug 04 '11 at 13:25
  • @enne, as I understand you want to go through the range of values with some constant step. In case of large step this approach could be too inaccurate. For example two functions could be close enough but never cross each other. In other way, it will take too much time to get results. Moreover there is no any guaranties that the step is small enough to get the correct answer. Methods I suggested have restriction, but they give you some guaranties in return. – eugene_che Aug 04 '11 at 13:49
  • Jep, that's what I wanted to know. Well, thanks tyz for your great answers! – enne87 Aug 04 '11 at 14:00