Derivative of Euclidean norm (L2 norm)
$begingroup$
Let:$x=[x_1, x_2]$ and $y = [y_1, y_2]$
What is the derivative of the square of the Euclidean norm of $y-x $?
I'm not sure if I've worded the question correctly, but this is what I'm trying to solve:
$$
frac{d}{dx}(||y-x||^2)
$$
It has been a long time since I've taken a math class, but this is what I've done so far:
$$
frac{d}{dx}(||y-x||^2)=frac{d}{dx}(||[y_1,y_2]-[x_1,x_2]||^2)
$$
Subtracting $x $ from $y$:
$$
frac{d}{dx}(||y-x||^2)=frac{d}{dx}(||[y_1-x_1,y_2-x_2]||^2)
$$
Taking the norm:
$$
frac{d}{dx}(||y-x||^2)=frac{d}{dx}((y_1-x_1)^2+(y_2-x_2)^2)
$$
Then at this point do I take the derivative independently for $x_1$ and $x_2$?
This is where I am guessing:
$$
frac{d}{dx}(||y-x||^2)=[frac{d}{dx_1}((y_1-x_1)^2+(y_2-x_2)^2),frac{d}{dx_2}((y_1-x_1)^2+(y_2-x_2)^2)]
$$
Which would result in:
$$
frac{d}{dx}(||y-x||^2)=[2x_1-2y_1,2x_2-2y_2]
$$
Is this correct? Thank you for your time.
derivatives norm
$endgroup$
add a comment |
$begingroup$
Let:$x=[x_1, x_2]$ and $y = [y_1, y_2]$
What is the derivative of the square of the Euclidean norm of $y-x $?
I'm not sure if I've worded the question correctly, but this is what I'm trying to solve:
$$
frac{d}{dx}(||y-x||^2)
$$
It has been a long time since I've taken a math class, but this is what I've done so far:
$$
frac{d}{dx}(||y-x||^2)=frac{d}{dx}(||[y_1,y_2]-[x_1,x_2]||^2)
$$
Subtracting $x $ from $y$:
$$
frac{d}{dx}(||y-x||^2)=frac{d}{dx}(||[y_1-x_1,y_2-x_2]||^2)
$$
Taking the norm:
$$
frac{d}{dx}(||y-x||^2)=frac{d}{dx}((y_1-x_1)^2+(y_2-x_2)^2)
$$
Then at this point do I take the derivative independently for $x_1$ and $x_2$?
This is where I am guessing:
$$
frac{d}{dx}(||y-x||^2)=[frac{d}{dx_1}((y_1-x_1)^2+(y_2-x_2)^2),frac{d}{dx_2}((y_1-x_1)^2+(y_2-x_2)^2)]
$$
Which would result in:
$$
frac{d}{dx}(||y-x||^2)=[2x_1-2y_1,2x_2-2y_2]
$$
Is this correct? Thank you for your time.
derivatives norm
$endgroup$
add a comment |
$begingroup$
Let:$x=[x_1, x_2]$ and $y = [y_1, y_2]$
What is the derivative of the square of the Euclidean norm of $y-x $?
I'm not sure if I've worded the question correctly, but this is what I'm trying to solve:
$$
frac{d}{dx}(||y-x||^2)
$$
It has been a long time since I've taken a math class, but this is what I've done so far:
$$
frac{d}{dx}(||y-x||^2)=frac{d}{dx}(||[y_1,y_2]-[x_1,x_2]||^2)
$$
Subtracting $x $ from $y$:
$$
frac{d}{dx}(||y-x||^2)=frac{d}{dx}(||[y_1-x_1,y_2-x_2]||^2)
$$
Taking the norm:
$$
frac{d}{dx}(||y-x||^2)=frac{d}{dx}((y_1-x_1)^2+(y_2-x_2)^2)
$$
Then at this point do I take the derivative independently for $x_1$ and $x_2$?
This is where I am guessing:
$$
frac{d}{dx}(||y-x||^2)=[frac{d}{dx_1}((y_1-x_1)^2+(y_2-x_2)^2),frac{d}{dx_2}((y_1-x_1)^2+(y_2-x_2)^2)]
$$
Which would result in:
$$
frac{d}{dx}(||y-x||^2)=[2x_1-2y_1,2x_2-2y_2]
$$
Is this correct? Thank you for your time.
derivatives norm
$endgroup$
Let:$x=[x_1, x_2]$ and $y = [y_1, y_2]$
What is the derivative of the square of the Euclidean norm of $y-x $?
I'm not sure if I've worded the question correctly, but this is what I'm trying to solve:
$$
frac{d}{dx}(||y-x||^2)
$$
It has been a long time since I've taken a math class, but this is what I've done so far:
$$
frac{d}{dx}(||y-x||^2)=frac{d}{dx}(||[y_1,y_2]-[x_1,x_2]||^2)
$$
Subtracting $x $ from $y$:
$$
frac{d}{dx}(||y-x||^2)=frac{d}{dx}(||[y_1-x_1,y_2-x_2]||^2)
$$
Taking the norm:
$$
frac{d}{dx}(||y-x||^2)=frac{d}{dx}((y_1-x_1)^2+(y_2-x_2)^2)
$$
Then at this point do I take the derivative independently for $x_1$ and $x_2$?
This is where I am guessing:
$$
frac{d}{dx}(||y-x||^2)=[frac{d}{dx_1}((y_1-x_1)^2+(y_2-x_2)^2),frac{d}{dx_2}((y_1-x_1)^2+(y_2-x_2)^2)]
$$
Which would result in:
$$
frac{d}{dx}(||y-x||^2)=[2x_1-2y_1,2x_2-2y_2]
$$
Is this correct? Thank you for your time.
derivatives norm
derivatives norm
asked May 23 '18 at 4:12
Trevor Danniel CowanTrevor Danniel Cowan
113
113
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
Sure, that's right.
Some sanity checks: the derivative is zero at the local minimum $x=y$, and when $xneq y$,
$$frac{d}{dx}|y-x|^2 = 2(x-y)$$
points in the direction of the vector away from $y$ towards $x$: this makes sense, as the gradient of $|y-x|^2$ is the direction of steepest increase of $|y-x|^2$, which is to move $x$ in the direction directly away from $y$.
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2792390%2fderivative-of-euclidean-norm-l2-norm%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Sure, that's right.
Some sanity checks: the derivative is zero at the local minimum $x=y$, and when $xneq y$,
$$frac{d}{dx}|y-x|^2 = 2(x-y)$$
points in the direction of the vector away from $y$ towards $x$: this makes sense, as the gradient of $|y-x|^2$ is the direction of steepest increase of $|y-x|^2$, which is to move $x$ in the direction directly away from $y$.
$endgroup$
add a comment |
$begingroup$
Sure, that's right.
Some sanity checks: the derivative is zero at the local minimum $x=y$, and when $xneq y$,
$$frac{d}{dx}|y-x|^2 = 2(x-y)$$
points in the direction of the vector away from $y$ towards $x$: this makes sense, as the gradient of $|y-x|^2$ is the direction of steepest increase of $|y-x|^2$, which is to move $x$ in the direction directly away from $y$.
$endgroup$
add a comment |
$begingroup$
Sure, that's right.
Some sanity checks: the derivative is zero at the local minimum $x=y$, and when $xneq y$,
$$frac{d}{dx}|y-x|^2 = 2(x-y)$$
points in the direction of the vector away from $y$ towards $x$: this makes sense, as the gradient of $|y-x|^2$ is the direction of steepest increase of $|y-x|^2$, which is to move $x$ in the direction directly away from $y$.
$endgroup$
Sure, that's right.
Some sanity checks: the derivative is zero at the local minimum $x=y$, and when $xneq y$,
$$frac{d}{dx}|y-x|^2 = 2(x-y)$$
points in the direction of the vector away from $y$ towards $x$: this makes sense, as the gradient of $|y-x|^2$ is the direction of steepest increase of $|y-x|^2$, which is to move $x$ in the direction directly away from $y$.
answered May 23 '18 at 4:27
user7530user7530
35.1k761114
35.1k761114
add a comment |
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2792390%2fderivative-of-euclidean-norm-l2-norm%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown