1

I type in my equations using ctrl+- to make it look nice and my answer outputs in "Subscript^(0,1)[a,b]" form? What is going on? In the answer some bits are displayed with the actual subscripts and some are displayed in the above form, even for the same variable.

Edit: more specifics I am taking the partial derivative of a function H wrt to b. H is a function of many variables one of which is a_b. Is it possible that Mathematica is trying to take the derivative of the subscript because there is a b in there?

H=d k2 + c^2 k4 + k5 s^2 + k1 U + 
 k3 \[Theta] + (g (1 - d - U - \[Theta]) \[Theta] - 
    U (1 + s Subscript[e, s])) Subscript[\[Lambda], 
  1] + (-c d + s U Subscript[e, s]) Subscript[\[Lambda], 2] + 
 U Subscript[\[Lambda], 3]

and

DHds = Simplify[D[H, s]]
WetlabStudent
  • 253
  • 2
  • 7
  • How about a real example... – ciao Feb 07 '14 at 02:43
  • 1
    It looks like you might be taking partial derivatives of subscripted variables. The most useful answer is: Don't use Ctrl- to make it "look nice"... that's the problem right there! They only look nice, but are a pain in the butt when you want to do other things with them (also depends on what you want to do). – rm -rf Feb 07 '14 at 02:58
  • 1
    You can select the cell contained your code and press Ctrl+Shift+I to change it into InputForm before you paste your code here. – xzczd Feb 07 '14 at 03:39
  • I remember someone saying that mathematica SE was the friendliest and best SE for nicely getting new users to improve their question writing so that they stayed and became part of the community instead of leaving with with their tail between their legs like they do on many SEs, at the time I didn't know about this SEs existence but now I know exactly what they were talking about. Thanks for putting up with my crummy questions @xzczd and rm-rf – WetlabStudent Feb 07 '14 at 03:47
  • 2
    As rm-rf said, generally a PITA to use in the way you seem to want, but if you insist on "prettiness", you can just enclose the subscripts in your original definitions in double-quotes... – ciao Feb 07 '14 at 03:48
  • 3
    Try this: use es instead of Subscript[e, s], λ1 instead of Subscript[λ, 1], etc. and do the computations. Finally, to "prettify" the output, do DHds /. {es -> Subscript[e, s], λ1 -> Subscript[λ, 1], λ2 -> Subscript[λ, 2]} – rm -rf Feb 07 '14 at 04:40
  • In the edited text you say that you take the derivatve wrt b and that there is a a_b, but in the code I see the derivative rt s and e_s. So which is which? Please clarify and edit. – magma Feb 09 '14 at 13:34
  • Also related: this, this and many more. – István Zachar Nov 30 '15 at 20:41

0 Answers0