1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Area in shades region (Matlab)

  1. Aug 11, 2014 #1

    Maylis

    User Avatar
    Gold Member

    ImageUploadedByPhysics Forums1407795886.518929.jpg
    This is a part matlab and part math question. I know for the shaded region, I would usually do
    ##A_{shaded} = \int_{inter(2)}^{inter(3)} f_{1}(x) \mathrm{d}x - \int_{inter(2)}^{inter(3)} f_{2}(x) \mathrm{d}x##

    However, since it appears they want the function handle to be just one line, am I allowed to do

    Code (Text):
    fh = @(x) -0.1*x.^3 - 0.5*x.^2 - 2.2*x + 9
    Since I can't make two integrals and just subtract them?

    In other words, would it be correct to say
    ##A_{shaded} = \int_{inter(2)}^{inter(3)} (f_{1}(x)-f_{2}(x)) \mathrm{d}x##?
     
    Last edited: Aug 11, 2014
  2. jcsd
  3. Aug 12, 2014 #2

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    Yes, of course, that's correct. One of the first things you should learn about integrals is that they are "linear": [tex]\int_a^b (\alpha f+ \beta g) dx= \alpha\int_a^b f dx+ \beta \int_a^b g dx[/tex]
     
    Last edited: Aug 12, 2014
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Area in shades region (Matlab)
Loading...