Questions tagged [equation-solving]

Questions on the analytic and numerical equation solving functions of Mathematica (Solve, Reduce, NSolve, FindRoot, DSolve, RSolve, etc.).

Solving equations and equation systems with Mathematica's toolkit. This includes the analytic solver family: Solve, DSolve, RSolve, LinearSolve, Reduce, FindInstance, etc. that can solve symbolic equations or inequalities in an exact way; and the numerical solver family: NSolve, NDSolve, FindRoot,

Questions should be simple, clear and well stated. Always try to reduce the problem to a bare minimum (even if it is semantically does not make sense) that illustrates the intent of the question. Please double-check that your variables are cleared and parameters and boundary conditions are set (where it is required). Provide code in InputForm and not as row boxes. This site supports $\LaTeX$, so the background information can also be provided in neatly typeset math. Please avoid using $\LaTeX$ in the code itself.

Ideally, the question must also be accompanied by the appropriate math tag such as , or . If simplification is involved consider using the tag .

Useful links:

Example questions:

6506 questions
41
votes
5 answers

Does Mathematica have a built-in tool that allows one to operate on both sides of an equation?

Geogebra has a very neat CAS view that allows one to solve an equation step by step in the following fashion: $\quad \quad \quad \quad \quad \quad \quad \quad \quad $ You type an equation and can then apply operations to both sides of the…
Red Banana
  • 5,329
  • 2
  • 29
  • 47
24
votes
2 answers

FindRoot Domain restriction

I am solving a system of four non-linear equations in four variables using FindRoot. I have some sense of the relationship between the variables so I don't want Mathematica to do its computations in certain funky regions of the domain. For example,…
Amatya
  • 6,888
  • 3
  • 26
  • 35
16
votes
1 answer

Strange behaviour of Reduce for Mod[x,1]

For every integer $x$ the equation Mod[x, 1] == 0 holds. While Simplify[Mod[x, 1] == 0, Element[x,Integers]] gives True, Reduce[Mod[x, 1] == 0, x, Integers] gives False. Why?
carlos
  • 163
  • 3
16
votes
2 answers

Figuring when the minute and hour hand coincide on a clock

I would like to list all possible times in a 12-hour period, where the hour hand overlaps the minute hand completely. This is really a question about three distinct things - to be done in Mathematica - though only the first of the following points…
Steve D
  • 2,199
  • 1
  • 17
  • 22
16
votes
2 answers

Nice cubic polynomials

Let a polynomial with integer coefficients be nice if this polynomial has distinct integer roots; its derivative has also integer roots. For instance $$p(x)=x(x-9)(x-24),\\ p'(x)=3(x-4)(x-18)$$ is the smallest known nice cubic polynomial. Smallest…
yarchik
  • 18,202
  • 2
  • 28
  • 66
15
votes
3 answers

NSolve gives additional solutions that don't satisfy the equations!

I am trying to solve the following polynomial equations in Mathematica: e= {-1 + c[1]^2 + s[1]^2, -1 + c[2]^2 + s[2]^2, -1 + c[3]^2 + s[3]^2, -1 + (-0.70873 c[1] + c[2] - 0.70548 s[1]) y1[ 1], -1 + (-0.916596 c[2] + c[3] + 0.399814…
dbm
  • 1,239
  • 7
  • 21
15
votes
1 answer

Why does repeating an equation help in FindRoot?

I'm trying to understand this behavior of FindRoot. Consider a sample function (the one I'm actually interested in is far more complicated, but has similar issues) and the following arguments: crazyFunction[x_, y_] := N@Norm[{x + 2 y}] yact =…
Eli Lansey
  • 7,499
  • 3
  • 36
  • 73
14
votes
2 answers

How can I find solutions for this equation?

I have a function cxyz[s1, e1, s2, e2], and I want to find at least one set of {s1, e1, s2, e2} for which the function's output is {2, 2, 2}. Both NSolve and Solve give me that there are no solutions, but by manually adjusting the variables I can…
INeedHelp
  • 143
  • 3
14
votes
4 answers

Why does Mathematica struggle with solving this equation?

Consider the evaluation of the following expression In[20]:= Reduce[ 1000 * 1.0609^t == 1500, t] During evaluation of In[20]:= Reduce::ratnz: Reduce was unable to solve the system with inexact coefficients. The answer was obtained by solving a…
WalkingRandomly
  • 4,107
  • 1
  • 20
  • 36
14
votes
2 answers

How do I solve this equation?

I want to solve the equation $$ f(f(-1)) = \sqrt{2} + g(f(2)), $$ where $$f(x) = \dfrac{a}{x^2} - 3x + 2, \quad g(x) = a\cdot \sin 2x$$ $a$ is unknown. The solution is $a \approx{-5.81}$. I tried Clear[f]; Clear[g]; f[x_] := a/x^2 - 3 x + 2; g[x_]…
minthao_2011
  • 4,503
  • 3
  • 31
  • 46
13
votes
4 answers

How to eliminate variables when using Solve[]

In certain problems, we need to solve systems of equations and get results in terms of just selected variables. For example, how could we solve eqn==0 below for c3 and c4 expressed in terms of c1 and c2 only, without a1 or a2? eqn = {{c1, c2}, {c1,…
Jerry Guern
  • 4,602
  • 18
  • 47
13
votes
4 answers

How can I find all values of $m$ such that my cubic equation has three different positive solutions?

I want to find all the values of $m$ such that the equation $$-m^3 + 2 m^2 x + (-2 m - 1) x^2 + m + x^3=0$$ has three different positive solutions. I tried Clear[f]; f[x_] := -m^3 + 2 m^2 x + (-2 m - 1) x^2 + m + x^3; sol = Solve[D[f[x], x] == 0,…
minthao_2011
  • 4,503
  • 3
  • 31
  • 46
13
votes
1 answer

Has Mathematica 12 gotten worse at solving simple equations?

Mathematica used to be easily able to solve an equation like this: Reduce[Log[Sqrt[k p]/Log[k]] == 0, p] (I can easily do it myself, at least I can find the solution p = log(k)^2/k.) Now in Mathematica 12, all I get is Reduce::nsmet: This system…
Thomas Ahle
  • 503
  • 3
  • 8
12
votes
1 answer

Solve[ ] with Method -> Reduce gives a different result than Reduce[ ]

Why does Solve[Sqrt[x + Sqrt[x]] - Sqrt[x - Sqrt[x]] == m Sqrt[x/(x + Sqrt[x])], x, Reals, Method -> Reduce] give a different result than Reduce[Sqrt[x + Sqrt[x]] - Sqrt[x - Sqrt[x]] == m Sqrt[x/(x + Sqrt[x])], x, Reals] note that…
Zero
  • 727
  • 5
  • 13
11
votes
3 answers

Problems Computing (in a reasonable amount of time) Solutions to a System of Inequalities

For my Cryptography research I am interested in finding solutions to the following inequalities in terms of $r$ and $s$, where $p$ is some fixed constant. $$\begin{align} 2^{p - s + 4} + 2^{p - r} + 2^{p - r - s + 4} + 13/4 < 2^{p - 8} \\ 2^{p - r +…
Samuel Reid
  • 629
  • 4
  • 15
1
2 3
99 100