Derivative of max function












21












$begingroup$


I was just wondering what the derivative of $f(x) = max(0,1-x)^{2}$ would be. What technique do you use to determine this derivative?










share|cite|improve this question











$endgroup$








  • 3




    $begingroup$
    Don't you mean $max(0, (1-x)^2)$?
    $endgroup$
    – Javier
    Apr 21 '13 at 19:05






  • 2




    $begingroup$
    since $(1-x)^2 ge 0 $ (for x a real number), $max(0,(1-x)^2)$ is equal to $(1-x)^2$
    $endgroup$
    – Andre Holzner
    Jun 8 '16 at 12:35


















21












$begingroup$


I was just wondering what the derivative of $f(x) = max(0,1-x)^{2}$ would be. What technique do you use to determine this derivative?










share|cite|improve this question











$endgroup$








  • 3




    $begingroup$
    Don't you mean $max(0, (1-x)^2)$?
    $endgroup$
    – Javier
    Apr 21 '13 at 19:05






  • 2




    $begingroup$
    since $(1-x)^2 ge 0 $ (for x a real number), $max(0,(1-x)^2)$ is equal to $(1-x)^2$
    $endgroup$
    – Andre Holzner
    Jun 8 '16 at 12:35
















21












21








21


7



$begingroup$


I was just wondering what the derivative of $f(x) = max(0,1-x)^{2}$ would be. What technique do you use to determine this derivative?










share|cite|improve this question











$endgroup$




I was just wondering what the derivative of $f(x) = max(0,1-x)^{2}$ would be. What technique do you use to determine this derivative?







calculus






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Apr 21 '13 at 18:33







user17762

















asked Apr 21 '13 at 18:27









phil12phil12

5823816




5823816








  • 3




    $begingroup$
    Don't you mean $max(0, (1-x)^2)$?
    $endgroup$
    – Javier
    Apr 21 '13 at 19:05






  • 2




    $begingroup$
    since $(1-x)^2 ge 0 $ (for x a real number), $max(0,(1-x)^2)$ is equal to $(1-x)^2$
    $endgroup$
    – Andre Holzner
    Jun 8 '16 at 12:35
















  • 3




    $begingroup$
    Don't you mean $max(0, (1-x)^2)$?
    $endgroup$
    – Javier
    Apr 21 '13 at 19:05






  • 2




    $begingroup$
    since $(1-x)^2 ge 0 $ (for x a real number), $max(0,(1-x)^2)$ is equal to $(1-x)^2$
    $endgroup$
    – Andre Holzner
    Jun 8 '16 at 12:35










3




3




$begingroup$
Don't you mean $max(0, (1-x)^2)$?
$endgroup$
– Javier
Apr 21 '13 at 19:05




$begingroup$
Don't you mean $max(0, (1-x)^2)$?
$endgroup$
– Javier
Apr 21 '13 at 19:05




2




2




$begingroup$
since $(1-x)^2 ge 0 $ (for x a real number), $max(0,(1-x)^2)$ is equal to $(1-x)^2$
$endgroup$
– Andre Holzner
Jun 8 '16 at 12:35






$begingroup$
since $(1-x)^2 ge 0 $ (for x a real number), $max(0,(1-x)^2)$ is equal to $(1-x)^2$
$endgroup$
– Andre Holzner
Jun 8 '16 at 12:35












3 Answers
3






active

oldest

votes


















30












$begingroup$

It might be of help to sketch the function or write it without the $max$. We get
$$f(x) = begin{cases} (1-x)^2 & text{if } x leq 1\ 0 & text{if }x geq 1end{cases}$$
It is easy to work out the derivative everywhere except at $x=1$.
At $x=1$, work out explicitly from definition.
$$lim_{h to 0^+} dfrac{f(1+h) - f(1)}{h} = 0$$
$$lim_{h to 0^-} dfrac{f(1+h) - f(1)}{h} = lim_{hto 0^-} dfrac{h^2}{h} = 0$$
Hence, we have
$$f'(x) = begin{cases} 2(x-1) & text{if } x leq 1\ 0 & text{if }x geq 1end{cases}$$






share|cite|improve this answer









$endgroup$





















    5












    $begingroup$

    HINT : Analyze this function on different intervals.






    share|cite|improve this answer









    $endgroup$













    • $begingroup$
      If x >= 1, f'(x) = 0, else f'(x) = -2(1-x)?
      $endgroup$
      – phil12
      Apr 21 '13 at 18:31










    • $begingroup$
      Now what happens when x = 1 ? Does f'(1) exist ?
      $endgroup$
      – Kalissar
      Apr 21 '13 at 18:33



















    2












    $begingroup$

    I would generalize this as follows:



    Let



    f(x) = max(0, g(x))^2


    Then



    f'(x) = [2*g(x)*g'(x)] if g(x) is > 0 else [0]


    Does it make sense?






    share|cite|improve this answer









    $endgroup$














      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
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f368432%2fderivative-of-max-function%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      30












      $begingroup$

      It might be of help to sketch the function or write it without the $max$. We get
      $$f(x) = begin{cases} (1-x)^2 & text{if } x leq 1\ 0 & text{if }x geq 1end{cases}$$
      It is easy to work out the derivative everywhere except at $x=1$.
      At $x=1$, work out explicitly from definition.
      $$lim_{h to 0^+} dfrac{f(1+h) - f(1)}{h} = 0$$
      $$lim_{h to 0^-} dfrac{f(1+h) - f(1)}{h} = lim_{hto 0^-} dfrac{h^2}{h} = 0$$
      Hence, we have
      $$f'(x) = begin{cases} 2(x-1) & text{if } x leq 1\ 0 & text{if }x geq 1end{cases}$$






      share|cite|improve this answer









      $endgroup$


















        30












        $begingroup$

        It might be of help to sketch the function or write it without the $max$. We get
        $$f(x) = begin{cases} (1-x)^2 & text{if } x leq 1\ 0 & text{if }x geq 1end{cases}$$
        It is easy to work out the derivative everywhere except at $x=1$.
        At $x=1$, work out explicitly from definition.
        $$lim_{h to 0^+} dfrac{f(1+h) - f(1)}{h} = 0$$
        $$lim_{h to 0^-} dfrac{f(1+h) - f(1)}{h} = lim_{hto 0^-} dfrac{h^2}{h} = 0$$
        Hence, we have
        $$f'(x) = begin{cases} 2(x-1) & text{if } x leq 1\ 0 & text{if }x geq 1end{cases}$$






        share|cite|improve this answer









        $endgroup$
















          30












          30








          30





          $begingroup$

          It might be of help to sketch the function or write it without the $max$. We get
          $$f(x) = begin{cases} (1-x)^2 & text{if } x leq 1\ 0 & text{if }x geq 1end{cases}$$
          It is easy to work out the derivative everywhere except at $x=1$.
          At $x=1$, work out explicitly from definition.
          $$lim_{h to 0^+} dfrac{f(1+h) - f(1)}{h} = 0$$
          $$lim_{h to 0^-} dfrac{f(1+h) - f(1)}{h} = lim_{hto 0^-} dfrac{h^2}{h} = 0$$
          Hence, we have
          $$f'(x) = begin{cases} 2(x-1) & text{if } x leq 1\ 0 & text{if }x geq 1end{cases}$$






          share|cite|improve this answer









          $endgroup$



          It might be of help to sketch the function or write it without the $max$. We get
          $$f(x) = begin{cases} (1-x)^2 & text{if } x leq 1\ 0 & text{if }x geq 1end{cases}$$
          It is easy to work out the derivative everywhere except at $x=1$.
          At $x=1$, work out explicitly from definition.
          $$lim_{h to 0^+} dfrac{f(1+h) - f(1)}{h} = 0$$
          $$lim_{h to 0^-} dfrac{f(1+h) - f(1)}{h} = lim_{hto 0^-} dfrac{h^2}{h} = 0$$
          Hence, we have
          $$f'(x) = begin{cases} 2(x-1) & text{if } x leq 1\ 0 & text{if }x geq 1end{cases}$$







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Apr 21 '13 at 18:32







          user17762






























              5












              $begingroup$

              HINT : Analyze this function on different intervals.






              share|cite|improve this answer









              $endgroup$













              • $begingroup$
                If x >= 1, f'(x) = 0, else f'(x) = -2(1-x)?
                $endgroup$
                – phil12
                Apr 21 '13 at 18:31










              • $begingroup$
                Now what happens when x = 1 ? Does f'(1) exist ?
                $endgroup$
                – Kalissar
                Apr 21 '13 at 18:33
















              5












              $begingroup$

              HINT : Analyze this function on different intervals.






              share|cite|improve this answer









              $endgroup$













              • $begingroup$
                If x >= 1, f'(x) = 0, else f'(x) = -2(1-x)?
                $endgroup$
                – phil12
                Apr 21 '13 at 18:31










              • $begingroup$
                Now what happens when x = 1 ? Does f'(1) exist ?
                $endgroup$
                – Kalissar
                Apr 21 '13 at 18:33














              5












              5








              5





              $begingroup$

              HINT : Analyze this function on different intervals.






              share|cite|improve this answer









              $endgroup$



              HINT : Analyze this function on different intervals.







              share|cite|improve this answer












              share|cite|improve this answer



              share|cite|improve this answer










              answered Apr 21 '13 at 18:29









              KalissarKalissar

              18319




              18319












              • $begingroup$
                If x >= 1, f'(x) = 0, else f'(x) = -2(1-x)?
                $endgroup$
                – phil12
                Apr 21 '13 at 18:31










              • $begingroup$
                Now what happens when x = 1 ? Does f'(1) exist ?
                $endgroup$
                – Kalissar
                Apr 21 '13 at 18:33


















              • $begingroup$
                If x >= 1, f'(x) = 0, else f'(x) = -2(1-x)?
                $endgroup$
                – phil12
                Apr 21 '13 at 18:31










              • $begingroup$
                Now what happens when x = 1 ? Does f'(1) exist ?
                $endgroup$
                – Kalissar
                Apr 21 '13 at 18:33
















              $begingroup$
              If x >= 1, f'(x) = 0, else f'(x) = -2(1-x)?
              $endgroup$
              – phil12
              Apr 21 '13 at 18:31




              $begingroup$
              If x >= 1, f'(x) = 0, else f'(x) = -2(1-x)?
              $endgroup$
              – phil12
              Apr 21 '13 at 18:31












              $begingroup$
              Now what happens when x = 1 ? Does f'(1) exist ?
              $endgroup$
              – Kalissar
              Apr 21 '13 at 18:33




              $begingroup$
              Now what happens when x = 1 ? Does f'(1) exist ?
              $endgroup$
              – Kalissar
              Apr 21 '13 at 18:33











              2












              $begingroup$

              I would generalize this as follows:



              Let



              f(x) = max(0, g(x))^2


              Then



              f'(x) = [2*g(x)*g'(x)] if g(x) is > 0 else [0]


              Does it make sense?






              share|cite|improve this answer









              $endgroup$


















                2












                $begingroup$

                I would generalize this as follows:



                Let



                f(x) = max(0, g(x))^2


                Then



                f'(x) = [2*g(x)*g'(x)] if g(x) is > 0 else [0]


                Does it make sense?






                share|cite|improve this answer









                $endgroup$
















                  2












                  2








                  2





                  $begingroup$

                  I would generalize this as follows:



                  Let



                  f(x) = max(0, g(x))^2


                  Then



                  f'(x) = [2*g(x)*g'(x)] if g(x) is > 0 else [0]


                  Does it make sense?






                  share|cite|improve this answer









                  $endgroup$



                  I would generalize this as follows:



                  Let



                  f(x) = max(0, g(x))^2


                  Then



                  f'(x) = [2*g(x)*g'(x)] if g(x) is > 0 else [0]


                  Does it make sense?







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Jul 22 '17 at 6:14









                  khankhan

                  1488




                  1488






























                      draft saved

                      draft discarded




















































                      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.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f368432%2fderivative-of-max-function%23new-answer', 'question_page');
                      }
                      );

                      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







                      Popular posts from this blog

                      Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

                      Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

                      A Topological Invariant for $pi_3(U(n))$