I am very new to Wolframalpha and find it quite fascinating. But as I wanted to combine 4 derivatives of a single long function f, the input line was too short. So I tried some kind of substitution and found that such commands work:
f*2+f^2 where f=sin(x)
Here sin(x) is substituted for the letter f twice. BUT with derivatives the “where” command seems to fail sometimes, e.g.
(df/dx)+1 where f=sin(x)
Here the sin derivative is not performed. But with
df/dx where f=sin(x)
it works. Result: cos(x).
Therefore my question: Why does the substitution of f with the command “where” sometimes work and with a small variation it does not work anymore. Ist there maybe a better way to define a function f in advance or to substitute it?
Thank you for the reply. It shows that the substitution works in Wolfram, but I have not yet bought the programme, instead I am trying to do this calculation on the single-line input of the Wolframalpha website:
Here only one line of command is possible and thus the function assignment is not as easy as with the multi-line input in the full version. However, there is also the possibility of assignment with the “where” keyword (maybe a different command is better) as you see in my example N°1 and N°3 above. But it works only for some inputs and I am wondering why it does not work for all imputs like in my second example. I think the interpretation of the input is straightforward, but somehow it is not understood by Wolframalpha.
This is very surprising to me for such an easy input, because usually Wolframalpha understands more complicated input e.g. in unit transformations.
Can anyone help me with some correct input syntax to make things like “(df/dx)+1 where f=sin(x)” work in Wolframalpha?
very funny and curious answers that you got from Wolframalpha.
In fact I tried all your suggested notations like “/. {f → sin(x)}”, “D[f, x]” and they always work with the easy formula, like the derivative of sin(x) alone. But when you add “+1” to the expression which shall be derived, then the interpretation goes wrong or the programme writes down sin’(x) or sin(x)’ but does not evaluate it to cos(x). Why not? It seems to understand that it should now compute the derivative of sin(x) but it does NOT do it. Very strange, because if you do the derivative directly e.g. “d (sin(x)+1)/dx” it does it, even for very complicated input. This should do with substituting the complex input as f, too.
In mathematics too, you don’t write 1+\sin(x)'(x) for the derivative of \sin, of course you write 1+\sin'(x). The problem here is the Substitution of Sin[x] into the head of Derivative.
Well, I did not find out how to do the assignment of a function to a letter (e.g. f(x) = sin(x)) work with the single command line in Wolframalpha - except for the very simple case shown above. So I found an old Maxima release that I had on an old CD from university times. There the calculation worked out fine.