\(\int { 4{ e }^{ -7x }dx }\)
We’ll do this substitution with sympy, which is a python package. To use python, we’ll need to load the reticulate package:
Now that we have reticulate loaded, we can use sympy to solve this integral:
## -4*exp(-7*x)/7
The output in R isn’t as clean as when it comes from python. The python output looks like this:
## -220*t + 1050/t**3
We’ll take the above function and add ‘+ C’ to it so that we can calculate the contamination after 1 day:
\(N(t)=\frac { 1050 }{ { t }^{ 3 } } -220t+c\)
Now to solve, we’ll make some substitutions with the infomration we know: \(t\) = 1 and \(N(t)\) = 6530:
\(6530=\frac { 1050 }{ { 1 }^{ 3 } } -220(1)+c\)
Now, simplifying:
\(6530=830+c\)
\(c=5700\)
So the final equation is:
\(N(t)=\frac { 1050 }{ { t }^{ 3 } } -220t +5700\)
Looking at the chart above, the bars begin where \(x\) = 4.5 and end where \(x\) = 8.5. We can integrate the function at these points to find the area:
## 16.0000000000000
The area of the red rectangles is 16.0.
The first thing we can do is set these equations equal to each other and solve to find the intersecting points. We’ll use the solve function from sympy to solve this equation.
## [(-1,), (4,)]
To find the area bounded by the the given equations, we can integrate the functions at the two points we found:
## 125/6
The area under the curve is equivalent to 125/6 or:
## [1] 20.83333
To answer this question, we’ll need to find cost (C). We can find C with the following function. When looking at the storage cost per year (3.75 * x/2), we assume that half of the yearly inventory is kept on hand.
\(C=3.75(\frac { X }{ 2 } )+8.25(\frac { 110 }{ x } )\)
Simplifying we get:
\(C=1.875x+\frac { 907.50 }{ x }\)
Now, to find the minimum of the cost curve, we’ll take the derivative of the above function and then solve where the derivative is equal to 0. First, we’ll use sympy to find the derivative using the diff function.
## 1.875 - 907.5/x**2
The derivative is:
\(f'(x)=1.875-\frac { 907.50 }{ { x }^{ 2 } }\)
Now, we’ll set this equal to zero and solve:
## 22.0000000000000
Here we find that cost will be minimized if we order 22 flat irons each time. If we order 110 flat irons throughout the year, that means we should make…
## [1] 5
We should make 5 orders of 22 flat irons each throughout the year.
\(\int { ln(9x)\cdot { x }^{ 6 } }\)
## x**7*log(9*x)/7 - x**7/49
\({ x }^{ 7 }\frac { ln(9x) }{ 7 } -\frac { { x }^{ 7 } }{ 49 }\)
\(f(x)=\frac { 1 }{ 6x }\)
## 1
Probability density functions satisfy the following conditions:
\(f(x)\ge 0\) for all \(x\)
\(\int _{ -\infty }^{ \infty }{ f(x)dx=1 }\)
In this case, since our interval is 1 to \({ e }^{ 6 }\), we know that all x values will be greater than 0, which meets the first criteria. Additionally as we saw in integrating our function we got the value of 1, which meets the second criteria. In meeting these conditions we can say that \(f(x)\) is a probability distribution function on the interval [1,\({ e }^{ 6 }\)].