Group Abstract Group Abstract

Message Boards Message Boards

0
|
9.7K Views
|
6 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Having problems with integration

Posted 11 years ago
POSTED BY: Raymond Low
6 Replies

It might help to use PiecewiseExpand here. Integrate will have an easier time dealing with explicit Piecewise objects than with various other formulations thereof.

ycc[x_] = 
 PiecewiseExpand[
  3 Max[0, (-9 + x)]^3 + 1/4 Max[0, (-9 + x)]^4 + 
   7/2 Max[0, (-3 + x)]^3 - 1/4 Max[0, (-3 + x)]^4 - 12 x^2 + c1 x + 
   c2]

(* Out[86]= Piecewise[{{c2 + c1*x - 12*x^2, x <= 3}, 
     {(1/2)*(-1323 + 2*c2 + 243*x + 2*c1*x - 33*x^2 + x^3), x > 9}}, 
   (1/4)*(-459 + 4*c2 + 486*x + 4*c1*x - 228*x^2 + 26*x^3 - x^4)] *)

Integrate[ycc[x], x, x]

(* Out[87]= Piecewise[{{(1/2)*(c2*x^2 + (c1*x^3)/3 - 2*x^4), x <= 3}, 
     {(9/2)*(-18 + c1 + c2) - (9/10)*(-36 + 5*c1 + 5*c2) + 
         (1/40)*(3321*x + 
       5*(-459 + 4*c2)*x^2 + (10/3)*(243 + 2*c1)*x^3 - 
              190*x^4 + 13*x^5 - x^6/3), 
   Inequality[3, Less, x, LessEqual, 9]}}, 
   (81/2)*(-138 + 3*c1 + c2) - (81/40)*(-549 + 60*c1 + 20*c2) + 
     (1/40)*(82053*x + 
     10*(-1323 + 2*c2)*x^2 + (10/3)*(243 + 2*c1)*x^3 - 
          55*x^4 + x^5)] *)

I was not able to figure out what it was about the solving for the constants that you did not like. In particular that NSolve formulation looked fine. If it is giving something incorrect then there needs to be a better explanation of why, and of what is the desired result.

POSTED BY: Daniel Lichtblau
Posted 11 years ago
POSTED BY: Raymond Low

I know how frustrating it is to loose the outcome of an hour of work. Nevertheless, I would need to know the equations which 'create' the c1 and c2.

POSTED BY: Ulrich Mutze
Posted 11 years ago
POSTED BY: Raymond Low
POSTED BY: Ulrich Mutze
POSTED BY: Ivan Morozov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard