fm[f_]:=DSolve[{x’‘[t]+4x[t]=f,x’[t]==0,x[t]==0},x[t],t][[1,1,2]]
what does the brackets [[1,1,2]] means ?
fm[f_]:=DSolve[{x’‘[t]+4x[t]=f,x’[t]==0,x[t]==0},x[t],t][[1,1,2]]
what does the brackets [[1,1,2]] means ?
The function DSolve does not directly return the solution as a function. It returns a List of Rules which can contain multiple solutions.
So, after running DSolve, you have to extract the function out of the result. You can use Part. It’s usually better to do it with Replace or Lookup: Wolfram Support Quick Answers: How do I use the output of functions like Solve?