Implicit Differentiation with Mathematica

Click For Summary

Discussion Overview

The discussion revolves around the challenges of performing implicit differentiation using Mathematica, particularly focusing on the syntax and commands required to achieve the desired results. Participants share their experiences and troubleshooting steps related to differentiating equations of the form x = y - y^2.

Discussion Character

  • Homework-related
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant initially attempts to differentiate using D[x = y - y^2, x, NonConstants -> {y}] but encounters an error regarding variable validity.
  • Another participant suggests that y should be explicitly defined as a function of x, y[x].
  • Subsequent attempts using D[x = y[x] - y[x]^2, x, NonConstants -> {y}] lead to a recursion limit error, indicating a potential issue with the command structure.
  • Participants discuss the importance of using "==" instead of "=" for symbolic equations in Mathematica.
  • One participant notes that the output from Mathematica is 1 == D[y[x], x, NonConstants -> {y}] - 2 D[y[x], x, NonConstants -> {y}] y[x], which raises questions about the expected results.
  • Another participant emphasizes that the NonConstant specification may be redundant when y is already defined as a function of x.
  • Several participants highlight the need to start a new notebook to avoid conflicts with previously defined variables, suggesting that this may resolve recursion issues.
  • There is a discussion about the necessity of rewriting equations for Mathematica to interpret them correctly, with one participant noting that implicit differentiation can be tricky and may require multiple attempts.
  • One participant expresses uncertainty about their previous statements, indicating that the original problem may have been resolved by clearing variables and entering equations correctly.

Areas of Agreement / Disagreement

Participants express a range of experiences and solutions, with no clear consensus on the best approach to perform implicit differentiation in Mathematica. There are multiple competing views on the syntax and commands needed, and some participants remain uncertain about the correct method.

Contextual Notes

Limitations include potential misunderstandings of Mathematica's syntax, the impact of previously defined variables, and the need for careful equation structuring. The discussion reflects ongoing challenges and refinements in using Mathematica for implicit differentiation.

flyingpig
Messages
2,574
Reaction score
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
I'm pretty sure you need to explicitly say y is y[x].
 
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. >>
 
oops I read what you wrote incorrectly. I have no idea how mathematica would even try to do implicit differentiation.
 
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 "=".
 
Argh still not working, it's giving me

1 == D[y[x], x, NonConstants -> {y}] -
2 D[y[x], x, NonConstants -> {y}] y[x]
 
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.
 
I am trying to differentiate [tex]x = y - y^2[/tex]
 
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:

Similar threads

  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
49
Views
5K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K