5
$\begingroup$

I'm trying to define a function, call it "L", which itself is a function of other functions, such as:

L[x[t], y[t]]:= x'[t]+y'[t]

Then, I want to take a derivative of L[x[t], y[t]] with respect to t.

I really thought I'd be able to figure this out quickly, but no luck. Can someone help me?

$\endgroup$
1
  • 1
    $\begingroup$ Something like L[x_, y_, t_] := D[x, t] + D[y, t]? $\endgroup$ Jul 13, 2022 at 22:26

2 Answers 2

2
$\begingroup$

You can do

L[x_[t_],y_[t_]]:=x[t]+y[t];

Then

D[L[x[t],y[t]],t]
D[L[Sin[t],Cos[t]],t]
....

Mathematica graphics

$\endgroup$
5
$\begingroup$
$Version

(* "13.1.0 for Mac OS X x86 (64-bit) (June 16, 2022)" *)

Clear["Global`*"]

L[x_, y_] := D[x, t] + D[y, t]

L[x[t], y[t]]

(* Derivative[1][x][t] + Derivative[1][y][t] *)

To take the derivative

D[#, t] & /@ L[x[t], y[t]]

(* Derivative[2][x][t] + Derivative[2][y][t] *)

or

D[L[x[t], y[t]], t]

(* Derivative[2][x][t] + Derivative[2][y][t] *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.