All Questions
Tagged with calculus-and-analysis piecewise
69
questions
0
votes
0
answers
44
views
Problem Derivative (D) of function defined with Piecewise or UnitStep functions - SIMPLE BEAM PROBLEM, 3 SUPPORTS
I am solving a simple structural beam problem using slope-deflection approach - 3 support A(left- fixed), B(middle- pin), C(right - pin). Beam AB - uniform load, Beam BC - concentrated load in ...
2
votes
1
answer
90
views
Integrate regions in Plot/Piecewise
I have the following code:
...
1
vote
2
answers
55
views
Strange behavior when integrating vector valued piecewise function
The following straightforward integral should clearly equal $\{0,0\}$ for any $R\in\mathbb R$:
...
0
votes
1
answer
39
views
Piecewise integration doesn't evaluate
I'm trying to integrate the following function:
$$q(d, \theta) = q_x(d, \theta) + q_y(d, \theta) - 2q_x(d, \theta) q_y(d, \theta)$$
where $q_x(d, \theta) = \min\left(2 - d\cos\theta, d\cos\theta\right)...
4
votes
1
answer
67
views
Confusing cases in Piecewise
The following
FullSimplify[Integrate[Exp[I ω t] Sin[ω x]/ω, {ω, 0, ∞},
Assumptions -> t > 0 && x > 0]]
gives a piecewise output of the form
I ...
3
votes
2
answers
95
views
Derivative of piecewise function returns one more case
I define the following piecewise function:
U[c_,n_,g_,p_]:=Piecewise[{{c^(1-g)/(1-g)-n^(1+p)/(1+p),g!=1}, {Log[c]-n^(1+p)/(1+p),g==1}}]
When I take the derivative
<...
1
vote
1
answer
116
views
Derivative of long expression renders Piecewise[…<<…>>…] in Jupyter notebook
My mathematical problem is to solve the optimization problem:
$$ Max_{u} \quad \mathbb{E}[\gamma S-S^2]$$
where $$S= A_0 u X+a-\max(\alpha u X+b,0)$$
with $\gamma,A_0,a,\alpha,b$ some constants and $X\...
3
votes
2
answers
96
views
How do I integrate this piecewise function with Mathematica?
I came across the question of what percent of numbers from 0 to 1 have a logerithm whose floor is even. What I did was I made a piecewise function: ...
0
votes
1
answer
354
views
How to obtain the convolution of these functions?
I am starting to use Mathematica. I wanted to compute
$$\nabla F*\phi(x),\;x\in\mathbb{R^2}$$
where $F(x)=\ln\|x\|$ and $\phi(x)=\chi_{B(0,2)}(x)$.
I am a new user of this software, so I don't know ...
4
votes
1
answer
148
views
Mathematica 12.1 integrates functions individually but not their sum
I found something odd in MMA 12.1 when symbolically integrating DiracDelta and Piecewise. These functions are integrated individually but not their sum. The following code
...
5
votes
2
answers
317
views
Using Piecewise to create a periodic waveform
I want to create a piecewise function that repeats after t=T.
...
4
votes
2
answers
102
views
Plot and differentiate a piecewise vector function [closed]
Consider the map $f:\mathbb R^2\to \mathbb R$ defined as
$$ f(x,y)=\begin{cases}
\|(x,y)\|^2\sin(1/\|(x,y)\|) & (x,y)\neq0 \\
0 & (x,y) =0\\
\end{cases}$$
I am trying to get a ...
0
votes
1
answer
78
views
Difficult on integration the normalization of a piecewise function
I have a little problem; I have defined the following Piecewise-function in the variables {x,L,w}:
f[x_, L_, w_] := Piecewise[{{x w (L - x), 0 <= x <= L}}];
...
1
vote
1
answer
83
views
NDSolve with embedded piecewise function for state-variable
Given ODE:
$\dot{x}=-2 e^{-x^2} x + U$
where:
$U=-u_{as}$
$u_{as} = \begin{cases} \frac{e}{\psi_+-e}, & \mbox{if } e\mbox{>=0} \\ \frac{e}{e-\psi_-}, & \mbox{if } e\mbox{<0} \end{cases}$
...
1
vote
1
answer
123
views
Solving a complicated time-dependent function
I want to solve the following time-dependent system of equations:
...
4
votes
1
answer
390
views
How to convert a Piecewise function in a HeavisideTheta function?
I want to convert a Piecewise function in a HeavisideTheta function in order to correctly evaluate its derivatives at the point of abrupt change and then integrate the result along the axis. How can I ...
1
vote
2
answers
180
views
How to take limits in Fourier series?
I have a Fourier series which produces an impulse train of period j+1. In principle, it is given by
...
2
votes
1
answer
325
views
Limit of multivariate piecewise function
Let's say we have a multivariate piecewise function
f[x1_,x2_]:=Piecewise[{{Sin[x1]/x1,x1>x2},{Sin[x2]/x2,x1<=x2}}]
Now we want to determine the limit in f(0,...
2
votes
2
answers
162
views
Double integration with a piecewise function gives wrong result
I am attempting to solve a double integral
$$I(t) = \int_0^t dt' \int_0^{t'} dt'' f(t'')$$
of a piecewise function of the type
$$f(t) = \begin{cases}1 & \text{for } 0 \leq t < a \\ -1 & \...
0
votes
1
answer
94
views
Understand output of Integration
Could someone help me understand the output of the following Integration in Mathematica?
Specifically,
(a) what is the meaning of "True"?
(b) Why is the answer in two parts which seem to overlap ...
0
votes
1
answer
54
views
Using subscripted symbol affects integration -- why?
Below is a sample program that shows that Integrate is giving different results depending on whether I name the variable duration1 or ...
0
votes
1
answer
70
views
Why do Integrate and DSolve/DSolveValue yield such complex expressions for Piecewise functions?
This code uses two different methods for integrating a very simple piecewise function but yields surprisingly complicated integrals:
...
2
votes
1
answer
120
views
Piecewise integration not giving continuous result
I'm trying to integrate a piecewise function symbolically and I'm ending up with discontinuities which is surprising since the help mentions that constants are determined to ensure continuity.
If I ...
0
votes
0
answers
46
views
Bad Integral evaluation for Piecewise function
I have been trying to evaluate this symbolic function:
f[ρ_, R_, α_, yp0_, yp_] := R*((ρ - R*Cos[α])^2 + (R*Sin[α])^2 + (yp-yp0)^2)^(-(1/2));
Mathematica can ...
1
vote
0
answers
81
views
Speed up Integrate around Max/Min or Piecewise
Integrate around a convex combination of two functions containing Min or Max or ...
5
votes
2
answers
630
views
Integration of a piecewise function with parameters
Here is a simple piece-wise and continuous function:
f[t_,a_,b_]:=Piecewise[{{a t,t<1},{a,t<1+b},{a(2+b-t),t<2+b}}]
When I integrate ...
0
votes
1
answer
63
views
Integrating a function "bit by bit"
I am trying to integrate a function. But for this task I need to do it
"bit by bit". I created a working example that shows the problem.
...
5
votes
1
answer
168
views
Reduce to Piecewise
There are some similar posts on SE, but none of them seems to exactly address my issue.
I need to integrate a rather complicated function (over $x>1$) separately over two domains defined as ...
2
votes
0
answers
64
views
Make Mathematica evaluate an integral symbolically
The following integral has a symbolic solution, which MMA does not return.
$\kappa(x) \begin{cases}
\text{mod}(x,1)\le0.5: & 1\\
\text{mod}(x,1)>0.5: & 0
\end{cases}$
$f(z)=\int_0^1 \...
1
vote
0
answers
64
views
Piecewise function inside Integrate - Wrong result
I tried to evaluate the following integral:
...
1
vote
1
answer
192
views
Integrating piecewise function in two variables
I want to find (and plot) the integral of a 'smooth' version of the Möbius function MoebiusMu[x]:
...
1
vote
1
answer
142
views
Strange behaviour in derivative of Floor function
The function Floor[x] is piecewise constant, hence its derivatives should be piecewise zero.
This is far from true in Mathematica
In[497]:= $Version
Out[497]= "10.1.0 for Microsoft Windows (64-...
1
vote
2
answers
260
views
Problem with the integration of this piecewise function
I encounter a problem when I try to integrate the piecewise function defined in the following code:
...
0
votes
1
answer
1k
views
Finding the tangent to a piecewise function
I'm new to Mathematica and I am trying to calculate the expression of the tangent to the curve
...
0
votes
0
answers
458
views
Integral of a step function ,
I am trying to integrate a step function given in a book, but it doesn't work.
...
0
votes
0
answers
242
views
Implicit function: derivative of piecewise function that has a FindRoot in one of the pieces
I have a piecewise function that has as one piece the result of a numerical approximation, like in the example below:
...
1
vote
2
answers
796
views
NDSolve with Piecewise function
I have the following code on Mathematica
...
4
votes
1
answer
117
views
Simplify integral with piecewise expression
How can I simplify this integral?
Integrate[Piecewise[{{c[x], 0 <= x <= 1/2}, {0, True}}], {x, 0, 1}]
I think it should be the same as
...
2
votes
1
answer
603
views
Force derivative of piecewise function at boundary points to be one-sided derivative
I've defined a smooth step function given as
f[x_] = Piecewise[{
{y0, x<x0-dx/2},
{y0+1/2(y1-y0)(1-Cos[Pi*x/dx]), x<x0+dx/2},
{y0, True}
}];
...
6
votes
3
answers
1k
views
Integrating a piecewise function with symbolic pieces
Suppose I want to compute the antiderivative of this simple function:
$$f(t)=\begin{cases}
1 & \text{if $0\le t\le t_1$,} \\
-1 & \text{if $t_1\le t\le t_2$}, \\
0 & \text{otherwise,}
\end{...
1
vote
1
answer
143
views
Cross-sections of a revolutionplot3D of a piece-wise function
I trying to get multiple cross-sections of a revolution plot I made from a piece-wise function.
The end goal would be to calculate integrals underneath those cross-sections.
my code looks like this:
<...
4
votes
3
answers
1k
views
Most efficient way to integrate a linear piecewise function
I am having a lot of trouble integrating a simple function. Here's the context: I generate data from two distributions, and I want to calculate the overlap coefficient of representing those datasets ...
1
vote
2
answers
112
views
Piecewise integration fail or something else?
I have a not-so-complicated piecewise cubic function, shown below as the yellow curve on the right. It's derivative is on the left; the blue lines are references. Please see the code below where I ...
1
vote
1
answer
732
views
Variable Increments in a Table
I am working on a problem involving the piecewise function:
$$x^2 \quad \mbox{if } \quad x < 2$$
$$(x-3)/(\sqrt{x-2}-1) \quad \mbox{if } \quad x \geq 2$$
I am supposed to find ...
1
vote
1
answer
213
views
Interpretation of HeavisideTheta Integration Output
I need to integrate integrals of the type
Integrate[Boole[2 k*q >= Absolute[p^2 - k^2 - q^2]], q]
where $q$, $k$, and $p$ go from $0$ to $1$.
To learn to ...
0
votes
0
answers
201
views
Minimize integral with piecewise functions
I am not an experienced user of Mathematica.
I would like to find parameters $d1,d2,d3,e1,e2,e3$ which minimize such an integral (given $c11,c12,c13,c21,c22,c23,c31,c32,c33$):
$\int_{0}^{1}\int_{0}^{...
4
votes
3
answers
225
views
Getting error message when integrating a simple piecewise function
I reviewed the following questions:
question 1 and question 2, but I need to the following integral of a piecewise function:
...
10
votes
2
answers
263
views
Problem with Integrate with Piecewise and PrincipalValue
Bug introduced in 8.0.4 or earlier and persisting through 11.3
In the course of developing an alternative solution for question 127301,
With,
...
2
votes
2
answers
113
views
Derivation of this piecewise function introduces "numerical noise"
The following function is a piecewise function. It's easy to plot with option Exclusions->None but it's derivative is hard to evaluate:
...
0
votes
1
answer
142
views
Strange behavior of derivative when using Abs[] [duplicate]
This code where I try to visualize Newton's Method on the function $f(x)=\sqrt{|x|}$ works fine when I define $f(x)$ piecewise. Then why doesn't it work when I define ...