Implicit Differentiation with Mathematica

In summary, the conversation discusses the use of the function D in Mathematica to perform implicit differentiation. The issue of recursion depth exceeding and using the correct syntax for defining variables is addressed. The conversation also touches on the importance of starting a new notebook to clear all variables and the tricky nature of implicit differentiation in Mathematica.
  • #1
flyingpig
2,579
1

Homework Statement




I tried using D[x = y - y^2, x, NonConstants -> {y}] and it keeps telling me that y - y^2 is not a valid variable.
 
Physics news on Phys.org
  • #2
I'm pretty sure you need to explicitly say y is y[x].
 
  • #3
I tried again using

D[x = y[x] - y[x]^2, x, NonConstants -> {y}]

And it says

$RecursionLimit::reclim: Recursion depth of 256 exceeded. >>

Further output of $RecursionLimit::reclim will be suppressed during this calculation. >>
 
  • #4
oops I read what you wrote incorrectly. I have no idea how mathematica would even try to do implicit differentiation.
 
  • #5
flyingpig said:
I tried again using

D[x = y[x] - y[x]^2, x, NonConstants -> {y}]

And it says

$RecursionLimit::reclim: Recursion depth of 256 exceeded. >>

Further output of $RecursionLimit::reclim will be suppressed during this calculation. >>

Try D[x == y[x] - y[x]^2, x, NonConstants -> {y}]. Symbolic equations to be manipulated need "==" instead of "=".
 
  • #6
Argh still not working, it's giving me

1 == D[y[x], x, NonConstants -> {y}] -
2 D[y[x], x, NonConstants -> {y}] y[x]
 
  • #7
flyingpig said:
Argh still not working, it's giving me

1 == D[y[x], x, NonConstants -> {y}] -
2 D[y[x], x, NonConstants -> {y}] y[x]

What do you want it to say?

D[y[x], x, NonConstants -> {y}] represents the derivative of y with respect to x.
 
  • #8
I am trying to differentiate [tex]x = y - y^2[/tex]
 
  • #9
flyingpig said:
I am trying to differentiate [tex]x = y - y^2[/tex]

Is the answer not [itex]1=y^\prime-2yy^\prime[/itex]? That's what Mathematica outputs. Incidentally, the NonConstant part is redundant when you already specify that y is a function of x by writing y[x]. If you plug in D[x == y[x] - y[x]^2, x], you'll get 1 == y'[x] -2y[x]y'[x].

Try experimenting more with Mathematica. It's the only way to learn it and get the training wheels off.
 
  • #10
In[1]:= D[x==y[x]-y[x]^2,x]
Out[1]= 1==y'[x]-2y[x]y'[x]

and if you need it

In[2]:= Solve[%,y'[x]]
Out[2]= {{y'[x]->1/(1-2 y[x])}}
 
  • #11
flyingpig said:
I am trying to differentiate [tex]x = y - y^2[/tex]

EDIT#3::

Ok, I got the same problem with the recursion.

EDIT #4::

I know what's wrong.

You have to use [tex]y^2 - y = -x[/tex], otherwise Mathematica tries to assign y - y^2 into x.

you also need to start a new notebook in-case variables like x (or y) have values or equations in them. Starting a new notebook clears all variables.

EDIT #5::

basically, if you're going to do implicit differentiation in mathematica, you need to be careful what you put on the left hand side or right hand side of the equal sign. Putting a single variable on the left side, mathematica will interpret that as putting the whole right hand side into that single variable on the left hand side.

EDIT#6::

In[3]:= D[y[x]^2 - y[x] == -x, x]
output[3]:= -y'[x] + 2y[x]y'[x] = -1

Implicit differentiation is tricky in Mathematica because you might need to rewrite the original equation several times before Mathematica will interpret your intentions correctly.

EDIT #7::

actually I have no clue what I just previously said, because D[x==y[x]-y[x]^2,x] works as well. I think the original problem just need a new notebook (so all variables are cleared), and just need the user to enter the equations correctly, and use the built-in functions properly.
 
Last edited:

Related to Implicit Differentiation with Mathematica

1. What is implicit differentiation and why is it useful?

Implicit differentiation is a technique used in calculus to find the derivative of a function that is not explicitly written in terms of its independent variable. This is useful because it allows us to find the rate of change of a function even when it is not in the standard form of y = f(x). It is particularly helpful in solving equations involving multiple variables.

2. How does Mathematica perform implicit differentiation?

Mathematica uses the standard rules of calculus to perform implicit differentiation. It automatically recognizes that a function is implicitly defined and applies the chain rule and product rule as needed to find the derivative.

3. Can Mathematica handle implicit differentiation of multivariable functions?

Yes, Mathematica can handle implicit differentiation of functions with multiple variables. It can differentiate with respect to any of the independent variables and can also handle partial derivatives.

4. What are some common mistakes to avoid when using Mathematica for implicit differentiation?

One common mistake is forgetting to include the necessary syntax for implicit differentiation, such as using the double square brackets [[ ]] around the function. Another mistake is not specifying the variables when using the D function for differentiation.

5. Are there any limitations to using Mathematica for implicit differentiation?

While Mathematica is a powerful tool for implicit differentiation, it may have difficulty with more complex functions or those involving special functions. It is always important to double-check the results and consider using other methods if necessary.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
277
  • Calculus and Beyond Homework Help
Replies
2
Views
805
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
2
Replies
49
Views
3K
  • Differential Equations
Replies
16
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
967
  • Calculus
Replies
2
Views
794
  • Engineering and Comp Sci Homework Help
Replies
8
Views
1K
  • Calculus
Replies
16
Views
2K
  • Calculus and Beyond Homework Help
Replies
15
Views
1K
Back
Top