# Simple derivative not working [closed]

I'm a complete newbie to Mathematica. I've been using Wolfram Alpha Pro as well as MS Mathematics for a few months but wanted to dive into using a more powerful tool.

I'm having a problem with calculating a simple derivative and I can't figure out what I'm doing wrong. I tried using free-form input after unsuccessfully trying to use Mathematica syntax but I get the same results. The same query works fine in Wolfram Alpha Pro.

I'm getting pages of repetitive output. Here are a couple of screenshots. The second one is a continuation from further down showing "MaxFormatDepthExceeded" errors.

Any help is greatly appreciated. I apologize for such a basic question.

P.S. I've added a 3rd screenshot to illustrate the successful results for the same query in Wolfram Alpha Pro.

As an aside, can anyone suggest any resources to quickly jump-start my usage of Mathematica? I started to go through the documentation but some of it was quite dense and assumed a level of knowledge that I don't yet have as a first semester calculus student who hasn't done math in some time.

-

## closed as off-topic by Michael E2, rasher, bobthechemist, Öskå, KubaJun 26 '14 at 11:45

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Michael E2, rasher, bobthechemist, Öskå, Kuba
If this question can be reworded to fit the rules in the help center, please edit the question.

Your definition is rather confusing. You use == which is an equality test, and seem to define y in terms of both x and y. How would you define the derivative of an equation? –  Sjoerd C. de Vries Jun 25 '14 at 17:24
I'm not sure how to answer your question. I'm attempting to do implicit differentiation of that equation. I've added a screenshot of the successful results for the same query in Wolfram Alpha Pro. I realize that I might be butchering the terminology but as a first semester calculus student I'm still learning so feel free to correct me. BTW, I didn't put the == in there; that was done as Mathematica's interpretation of the free-form query. When I initially attempted to use Mathematica syntax I used a single =. Thanks for your help. –  WXB13 Jun 25 '14 at 17:53

I don't get the same output as you, when running from a fresh kernel:

Of course, this probably isn't too good either, as we've not indicated that $y$ is a function of $x$. Using the WA interface, I suppose I'd do something like so:

Of course, you've still got to solve for $y'$:

Solve[%, y'[x]]
(* Out:
{{y'[x] -> -(Tan[y[x]]/(-1 + x*Sec[y[x]]^2))}}
*)


With a little practice, you'll be able to roll this into one line in Mathematica:

Solve[D[y[x] == x*Tan[y[x]], x], y'[x]]
(* Out:
{{y'[x] -> -(Tan[y[x]]/(-1 + x*Sec[y[x]]^2))}}
*)


As far as your funky output goes, I strongly suspect that, prior to your In[10], you executed a command along the lines of y=xtan[y], which will certainly lead to a recursion problem. Worse, y will now be defined in a way that simply referring to it will again lead to a recursion problem Keep in mind that Mathematica syntax is precise, unlike that of WA.

-
Well, that explains it. I restarted the kernel and it worked as expected. I also clicked on the "Show all results" button after running this and it showed the result I was looking for: y'(x) = tan(y)/(1-x sec^2(y)) using this command: >Solve[Dt[y[x] == x*Tan[y[x]], x], Derivative[1][y][x]] I'm not clear on the all of the differences between this Solve syntax and yours. I believe that D is partial and Dt is a total derivative but I haven't researched exactly what that means yet. Now if I can just figure out how to evaluate at a specific point I'll be golden. Thanks. –  WXB13 Jun 25 '14 at 18:54
It looks as if my markdown isn't working as expected. I'll try to fix that. –  WXB13 Jun 25 '14 at 18:59
Hmmm...I exceeded the edit time limitation for comments. –  WXB13 Jun 25 '14 at 19:01
Glad it helped! Markdown in comments is somewhat different than markdown in a post, I believe. –  Mark McClure Jun 25 '14 at 19:06
D[y[x] == x*Tan[y[x]], x]


Derivative[1][y][x] == Tan[y[x]] + x Sec[y[x]]^2 Derivative[1][y][x]

-
Bob, I tried that and got similar (i.e. unsuccessful) results. –  WXB13 Jun 25 '14 at 18:13
Yes, I restarted the kernel and it fixed the problem. I'm guessing that Clear[y] is a more granular approach that only flushes the contents of the y variable. IIRC, I think that I tried quitting & restarting Mathematica and it didn't fix the problem. Thanks. –  WXB13 Jun 25 '14 at 19:07