CITE THIS NOTEBOOK: Working through implicit differentiation exercises by Peter Burbery. Wolfram Community DEC 28 2022.
I am going to do some exercises from the book Mathematical Methods in the Physical Sciences Third Edition by Mary L. Boas. The following exercise set is from page 203 in the section Chapter 4: Partial Differentiation section 6 Implicit Differentiation. I’m doing the exercises that have answers in the back of the book. I am going to solve the examples on page 202 as well.

Example 1

Given
x+
x

=t
, find
dx/dt
and
2
d
x/d
2
t
:
In[]:=
eqn=x+Exp[x]==t
Out[]=
x

+xt
In[]:=
ApplySides[Dt[#,{t}]&,eqn]
Out[]=
Dt[x,t]+
x

Dt[x,t]1
In[]:=
Solve[ApplySides[Dt[#,{t}]&,eqn],Dt[x,t]]
Out[]=
Dt[x,t]
1
1+
x


In[]:=
Solve[ApplySides[Dt[#,{t,2}]&,eqn],Dt[x,{t,2}]]/.Solve[ApplySides[Dt[#,{t}]&,eqn],Dt[x,t]]
Out[]=
Dt[x,{t,2}]-
x

3
(1+
x

)

In[]:=
Join[Solve[ApplySides[Dt[#,{t}]&,eqn],Dt[x,t]],First@Solve[ApplySides[Dt[#,{t,2}]&,eqn],Dt[x,{t,2}]]/.Solve[ApplySides[Dt[#,{t}]&,eqn],Dt[x,t]],2]
Out[]=
Dt[x,t]
1
1+
x

,Dt[x,{t,2}]-
x

3
(1+
x

)

In[]:=
Solve[ApplySides[Dt[#,{t,3}]&,eqn],Dt[x,{t,3}]]/.Join[Solve[ApplySides[Dt[#,{t}]&,eqn],Dt[x,t]],First@Solve[ApplySides[Dt[#,{t,2}]&,eqn],Dt[x,{t,2}]]/.Solve[ApplySides[Dt[#,{t}]&,eqn],Dt[x,t]],2]
Out[]=
Dt[x,{t,3}]-
x

-
3
x

3
(1+
x

)
+
1
2
(1+
x

)
2
(1+
x

)

In[]:=
Solve[ApplySides[Dt[#,{t,3}]&,eqn],Dt[x,{t,3}]]/.Join[Solve[ApplySides[Dt[#,{t}]&,eqn],Dt[x,t]],First@Solve[ApplySides[Dt[#,{t,2}]&,eqn],Dt[x,{t,2}]]/.Solve[ApplySides[Dt[#,{t}]&,eqn],Dt[x,t]],2]//FullSimplify
Out[]=
Dt[x,{t,3}]
x

(-1+2
x

)
5
(1+
x

)

There is a much more simpler way to do with ImplicitD:
In[]:=
ImplicitD[eqn,x,t]
Out[]=
1
1+
x

In[]:=
ImplicitD[eqn,x,{t,2}]
Out[]=
-
x

3
(1+
x

)
In[]:=
ImplicitD[eqn,x,{t,3}]
Out[]=
x

(-1+2
x

)
5
(1+
x

)
Derive up to 7 times:
In[]:=
Table[ImplicitD[eqn,x,{t,n}],{n,7}]
Out[]=

1
1+
x

,-
x

3
(1+
x

)
,
x

(-1+2
x

)
5
(1+
x

)
,-
x

(1-8
x

+6
2x

)
7
(1+
x

)
,
x

(-1+22
x

-58
2x

+24
3x

)
9
(1+
x

)
,-
x

(1-52
x

+328
2x

-444
3x

+120
4x

)
11
(1+
x

)
,
x

(-1+114
x

-1452
2x

+4400
3x

-3708
4x

+720
5x

)
13
(1+
x

)

It seems like there might be a pattern present here:
In[]:=
Transpose@NumeratorDenominator@Table[ImplicitD[eqn,x,{t,n}],{n,7}]
Out[]=
{{1,-
x

,
x

(-1+2
x

),-
x

(1-8
x

+6
2x

),
x

(-1+22
x

-58
2x

+24
3x

),-
x

(1-52
x

+328
2x

-444
3x

+120
4x

),
x

(-1+114
x

-1452
2x

+4400
3x

-3708
4x

+720
5x

)},{1+
x

,
3
(1+
x

)
,
5
(1+
x

)
,
7
(1+
x

)
,
9
(1+
x

)
,
11
(1+
x

)
,
13
(1+
x

)
}}
In[]:=
FindSequenceFunction/@Transpose@NumeratorDenominator@Table[ImplicitD[eqn,x,{t,n}],{n,7}]
Out[]=
FindSequenceFunction[{1,-
x

,
x

(-1+2
x

),-
x

(1-8
x

+6
2x

),
x

(-1+22
x

-58
2x

+24
3x

),-
x

(1-52
x

+328
2x

-444
3x

+120
4x

),
x

(-1+114
x

-1452
2x

+4400
3x

-3708
4x

+720
5x

)}],
#1
(
2
(1+
x

)
)
1+
x

&
The denominator has a pattern:
In[]:=
FindSequenceFunction[Denominator@Table[ImplicitD[eqn,x,{t,n}],{n,7}],n]
Out[]=
n
(
2
(1+
x

)
)
1+
x

Find the 12th derivative:
In[]:=
ImplicitD[eqn,x,{t,12}]//FullSimplify
Out[]=
1
23
(1+
x

)
x

(-1-2
x

(-2036+
x

(347519+4
x

(-3155488+
x

(39296215+2
x

(-103024019+3
x

(83389481+
x

(-96711749+24
x

(2176633+15
x

(-32891+2310
x

))))))))))
If we want the answer for 〈x,t〉 @ 〈0,1〉 we can use replace with an association created with AssociationThread:
In[]:=
Table[ImplicitD[eqn,x,{t,n}]/.AssociationThread[{x,t}->{0,1}],{n,2}]
Out[]=

1
2
,-
1
8

This matches the books result of
dx/dt=1/2
and
2
d
x/d
2
t
=-1/8
.

Example 2

Find the equation of the tangent line to the curve
3
x
-3
3
y
+xy+21=0
at the point 〈1,2〉.
In[]:=
eqn=
3
x
+-3
3
y
+xy+21==0
Out[]=
21+
3
x
+xy-3
3
y
0
In[]:=
ImplicitD[eqn,y,x]
Out[]=
-3
2
x
-y
x-9
2
y
In[]:=
ImplicitD[eqn,y,x]//FullSimplify
Out[]=
-
3
2
x
+y
x-9
2
y
In[]:=
ImplicitD[eqn,y,x]//FullSimplify//TraditionalForm
Out[]//TraditionalForm=
-
3
2
x
+y
x-9
2
y
In[]:=
ImplicitD[eqn,y,x]/.AssociationThread[{x,y}->{1,2}]
Out[]=
1
7
They get 1/7.
I can use a function from the Function Repository to find the equation of the tangent line.
In[]:=
PersistResourceFunction[{"TangentLine","TangentAndNormalLine"}]
Out[]=
Success
✓
Message: Successfully stored TangentLine as an initialization symbol.
PersistenceLocation: PersistenceLocation
Type: Local

,Success
✓
Message: Successfully stored TangentAndNormalLine as an initialization symbol.
PersistenceLocation: PersistenceLocation
Type: Local


In[]:=
TangentLine[eqn,{x,1},y]
Out[]=
SlopeInterceptEquationy
13
7
+
x
7
,PointSlopeEquation-2+y
1
7
(-1+x),StandardFormEquation-
x
7
+y
13
7
,Slope
1
7
,VerticalIntercept
13
7
,HorizontalIntercept-13,Plot

Out[]//TeXForm=
x^3+x y-3 y^3+21=0

6.5

Find the implicit derivative:
Enter the value 〈1,2〉:
Plot the tangent line:
The two forms are code equivalent with the transformations applied:
The two forms are also code equivalent without the transformations applied:
See the details:

6.6

Find the second implicit derivative.
Substitute the numbers in.
Wolfram Alpha might be helpful here:

6.10

I think this is related to the documentation for ImplicitD’s note in Possible Issues :
Find the derivative:
I like the exponential functions in the answer.
Substitute 〈0,0〉:

6.11

Question Generator

I’m interested in creating a question generator for functions for random implicit differentiation. Some of the questions I could ask are:
◼
  • What is dp/dq for example?
  • ◼
  • What is the derivative or second derivative at a particular point?
  • The problem is how to randomly generate functions that can be differentiated easily. Jon McLoone has created a resource function Random Polynomial which is a start.
    I was also thinking of finding a random graph and finding its Tutte polynomial or its chromatic polynomial or its flow polynomial.
    That’s a little too big.
    That’s still a little too big.
    This is still a very large polynomial for questions but I’ll keep it.
    What about a smaller graph?
    See the random graph:
    The question object works with a different answer that is the same:
    I can now make a notebook that generates random questions.
    I’m also going to attach some question notebooks I generated.

    Working through my questions

    5

    I also figured out a way to find the answer directly from the question: