# Subscript and Part: What's going on in this example?

## Example

I came across the following simple example from A Beginner's Guide to Mathematica, by McMahon and Topa, which I believe was written circa version 5.2. (FWIW, I'm using v9.)

(* simple differential equation *)
eqn = (D[y[ x], x] == A);

(* solve the differential equation *)
result = DSolve[eqn, y[x], x];


Note to question readers: For the input below, fill in the ... with result then hit (Ctrl + minus) to get a subscript, then type in [[1,1,2]] and evaluate the function. Sorry if this is a wonkish way to present the question, but I wasn't sure of the best way to handle the front-end representation of the original input. *)

(* extract a functional dependence *)
f[x_] := ...


Evaluating:

f[x]
(* -> A*x + C[1] *)


## Question

Can someone point me to documentation on this behavior or explain it? Looking at expression form (Ctrl + e) makes it clear that the front-end is interpreting the subscripted input to make this happen, but I've never seen it before.

Encountering this makes me wish developers would refactor the behavior so that one could easily apply functions other than Part in this manner.

-
I doubt if you will find this peculiar behavior documented. It strikes me as a bug. When I enter Subscript[result, [[1, 1, 2,]]], which ought to be equivalent, I get a syntax error from the code editor (in 8.0.4). –  m_goldberg Dec 15 '12 at 13:55
@m_goldberg Exactly why I asked the question. I wouldn't call it a bug, but the way it apparently works---purely through input (box) interpretation---struck me as odd. –  telefunkenvf14 Dec 15 '12 at 16:18

This is documented in Part >> More Information (Part >> Details in V9):

-
thanks @Mike, edited with v8 info. –  kglr Dec 15 '12 at 21:41
@MikeHoneychurch and @kguler Thanks for pointing out that this info was semi-hidden at the bottom of the 'Details' section in documentation for Part (was it 'More Information' in v8?). Was kinda driving me nuts that I hadn't come across this before... I've spent TONS of time in the docs... and BTW, does anyone else with the history feature was enabled for the doc center? (performance issues, etc., notwithstanding) –  telefunkenvf14 Dec 15 '12 at 21:41
@telefunkenvf14 I had seen this code style before so figured there must be something about it in the Part docs. There is also an example in the Scope section of the docs. –  Mike Honeychurch Dec 15 '12 at 21:47

Not an answer since I could not find where it is documented (but I did not spend much time searching)

But just to show that they are really same thing, which I did not know this myself as I do not really use subscripts as they do not work nicely across function calls.

But this shows that $x_{[[1]]}$ is really the same as $x[[1]]$ , it is just different syntax that is all

Actually, just looking at InputForm shows that the frontend changes it to Part

So, my conclusion from this quick analysis:

When [[ ]] appears in Subscript, it is converted to Part directly by the frontend, otherwise, it is left as Subscript as you can see below

I am sure this is documented somewhere, may be more time googling or in the documenation center might find it?

-
+1 for the screenshots. Your answer probably demonstrates the issue better than my original question. –  telefunkenvf14 Dec 15 '12 at 21:44