0
$\begingroup$

I have the following code:

Solve[-(Sin[x]/(α*Gamma[α])) - Subscript[a, 0][x]/(α*Gamma[α]) == 0, Subscript[a, 0][x]] 

For replacement SetDelayed instead of Rule, I rewrite

Solve[-(Sin[x]/(α*Gamma[α])) - Subscript[a, 0][x]/(α*Gamma[α]) == 0, Subscript[a, 0][x]] /. Rule -> SetDelayed 

I want to calculate

Sqrt[Pi]*Derivative[2][Subscript[a, 0]][x] 

But I do not have any output. Any suggestions?

$\endgroup$

2 Answers 2

1
$\begingroup$

For better readability I substituted the subscripted variable with b

fun = -(Sin[x] / (a Gamma[a])) - b / (a Gamma[a]) // Simplify 

enter image description here

sol = First[b /. Solve[fun == 0, b]] 

enter image description here

Now use D instead of Derivative

Sqrt[Pi] D[sol, {x, 2}] 

enter image description here

To get the same result with Derivative you would have to write

Sqrt[Pi] (-Derivative[2][Sin][x]) 

which is difficult to automate

$\endgroup$
0
$\begingroup$

You can see why studying the Trace: enter image description here

The culprit is that what you achieve with your substitution is to evaluate Subscript[a, 0][x] := -Sin[x].

Note that this is an expression of the form f[x] := foo[x], as opposite to f[x_] := foo[x]. In other words, you did not define a function, hence why Derivative does not work.

It's the same as doing

f[x] := Sin[x] Derivative[2][f][x] 

which will not work.

You can use your trick, provided you also convert x into x_:

Solve[ -(Sin[x]/(\[Alpha]*Gamma[\[Alpha]])) - f[x]/(\[Alpha]*Gamma[\[Alpha]]) == 0, f[x] ][[1, 1]] // {#[[1]] /. x -> x_, #[[2]]} & // Apply@SetDelayed 

and then you can use Derivative as you wanted (I used f[x] instead of Subscript[a, 0][x] here, for better readability.

Of course, you don't really need to do these kinds of hacks in the first place. The kind of solution provided by eldo is a better for most circumstances.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.