Alternative form of ArcSin[Sin[x]]
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
Is it possible to get the following result in Mathematica by using only built-in functions:
$$arcsin( sin(x)) = x $$ if $x in [-pi /2 , pi/2]$
$$arcsin ( sin(x)) = pi - x $$ if $x in [pi /2 , 3pi/2]$
simplifying-expressions trigonometry education
add a comment |Â
up vote
2
down vote
favorite
Is it possible to get the following result in Mathematica by using only built-in functions:
$$arcsin( sin(x)) = x $$ if $x in [-pi /2 , pi/2]$
$$arcsin ( sin(x)) = pi - x $$ if $x in [pi /2 , 3pi/2]$
simplifying-expressions trigonometry education
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Is it possible to get the following result in Mathematica by using only built-in functions:
$$arcsin( sin(x)) = x $$ if $x in [-pi /2 , pi/2]$
$$arcsin ( sin(x)) = pi - x $$ if $x in [pi /2 , 3pi/2]$
simplifying-expressions trigonometry education
Is it possible to get the following result in Mathematica by using only built-in functions:
$$arcsin( sin(x)) = x $$ if $x in [-pi /2 , pi/2]$
$$arcsin ( sin(x)) = pi - x $$ if $x in [pi /2 , 3pi/2]$
simplifying-expressions trigonometry education
simplifying-expressions trigonometry education
edited 11 hours ago
David G. Stork
22k21747
22k21747
asked 11 hours ago
Gennaro Arguzzi
315210
315210
add a comment |Â
add a comment |Â
5 Answers
5
active
oldest
votes
up vote
4
down vote
We can take the Floor
and Ceiling
from Carl's answer and expand them out:
PiecewiseExpand[
PowerExpand[ArcSin[Sin[x]], Assumptions -> x â Reals],
-ÃÂ/2 < x < 3ÃÂ/2
]
Hello @ChipHurst, can you tell me why in the second line of the output there is True instead of "-pi/2<=x<=pi/2" please?
â Gennaro Arguzzi
1 hour ago
add a comment |Â
up vote
3
down vote
@kglr was on the right track with PowerExpand
. With the default option Assumptions
->Automatic
, Mathematica may return a result that is not valid. On the other hand, if you give PowerExpand
a non-default assumption, then it will return a result valid given those assumptions. So, for your example:
Assuming[
x â Reals,
Simplify @ PowerExpand[ArcSin[Sin[x]], Assumptions -> x â Reals]
]
1/2 (-1)^(Ceiling[1/2 + x/ÃÂ] + Floor[-(1/2) + x/ÃÂ] +
Floor[1/2 + x/ÃÂ]) (ÃÂ + (-1)^(
Ceiling[1/2 + x/ÃÂ] + Floor[1/2 + x/ÃÂ]) ÃÂ + 2 x -
2 ÃÂ Floor[1/2 + x/ÃÂ])
Hello @CarlWoll, I have some difficult to interpret the solution. Can you explain me how it is related to the solution which I expected (the one in the question) please?
â Gennaro Arguzzi
1 hour ago
add a comment |Â
up vote
1
down vote
Plot[ArcSin[Sin[x]], ÃÂ/2 TriangleWave[x/(2 ÃÂ)], Abs[Mod[x - ÃÂ/2, 2 ÃÂ] - ÃÂ] - ÃÂ/2 +
0, -5, 5 // Evaluate,x, -10 ÃÂ, 10 ÃÂ]
With[x=RandomReal[-100,100,1000],
ArcSin[Sin[x]] - # //Chop//Union]& /@ ÃÂ/2 TriangleWave[x/(2 ÃÂ)], Abs[Mod[x-ÃÂ/2,2 ÃÂ]-ÃÂ]-ÃÂ/2
0, 0
add a comment |Â
up vote
0
down vote
Answer to the first question
Simplify[x == ArcSin[Sin[x]], -Pi/2 <= x <= Pi/2]
(* True *)
Hello @UlrichNeumann, if possible i'd like to avoid to specify the range -Pi/2 <= x <= Pi/2. I prefer a more general statement because the above one is valid also for instance when Simplify[x == ArcSin[Sin[x]], 0 <= x <= Pi/2]
â Gennaro Arguzzi
9 hours ago
@Gennaro Arguzzi You want to proveArcSin[Sin[x]]=="triangle function"
?
â Ulrich Neumann
9 hours ago
I'm looking for built-in functions that allow me to "simplify" arcsin(sin(x)).
â Gennaro Arguzzi
9 hours ago
add a comment |Â
up vote
0
down vote
An easy way is to define a new function sin
which will work as intended:
sin /: (ArcSin[sin[x :(_Real | _Integer| _Rational)]]
/;-(Pi/2)<=Mod[x, 2 Pi, -Pi/2] <= Pi/2) := x;
sin /: (ArcSin[sin[x :(_Real | _Integer| _Rational)]]
/; Pi/2<Mod[x, 2Pi,-Pi/2] < (3 Pi)/2) := Pi - x;
sin[x_] := Sin[x];
I intentionally restricted to real numbers (why I used heads Real
, Integer
, and Rational
) so that I can use Mod
.
Instead of trying to convert each Sin
to sin
, we can automate it by
$Pre = Function[# /. Sin -> sin];
Now, we do not have to do anything: The code works as expected. For example
Plot[ArcSin[Sin[x]], x, -Pi, 3 Pi]
add a comment |Â
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
We can take the Floor
and Ceiling
from Carl's answer and expand them out:
PiecewiseExpand[
PowerExpand[ArcSin[Sin[x]], Assumptions -> x â Reals],
-ÃÂ/2 < x < 3ÃÂ/2
]
Hello @ChipHurst, can you tell me why in the second line of the output there is True instead of "-pi/2<=x<=pi/2" please?
â Gennaro Arguzzi
1 hour ago
add a comment |Â
up vote
4
down vote
We can take the Floor
and Ceiling
from Carl's answer and expand them out:
PiecewiseExpand[
PowerExpand[ArcSin[Sin[x]], Assumptions -> x â Reals],
-ÃÂ/2 < x < 3ÃÂ/2
]
Hello @ChipHurst, can you tell me why in the second line of the output there is True instead of "-pi/2<=x<=pi/2" please?
â Gennaro Arguzzi
1 hour ago
add a comment |Â
up vote
4
down vote
up vote
4
down vote
We can take the Floor
and Ceiling
from Carl's answer and expand them out:
PiecewiseExpand[
PowerExpand[ArcSin[Sin[x]], Assumptions -> x â Reals],
-ÃÂ/2 < x < 3ÃÂ/2
]
We can take the Floor
and Ceiling
from Carl's answer and expand them out:
PiecewiseExpand[
PowerExpand[ArcSin[Sin[x]], Assumptions -> x â Reals],
-ÃÂ/2 < x < 3ÃÂ/2
]
answered 6 hours ago
Chip Hurst
19.5k15585
19.5k15585
Hello @ChipHurst, can you tell me why in the second line of the output there is True instead of "-pi/2<=x<=pi/2" please?
â Gennaro Arguzzi
1 hour ago
add a comment |Â
Hello @ChipHurst, can you tell me why in the second line of the output there is True instead of "-pi/2<=x<=pi/2" please?
â Gennaro Arguzzi
1 hour ago
Hello @ChipHurst, can you tell me why in the second line of the output there is True instead of "-pi/2<=x<=pi/2" please?
â Gennaro Arguzzi
1 hour ago
Hello @ChipHurst, can you tell me why in the second line of the output there is True instead of "-pi/2<=x<=pi/2" please?
â Gennaro Arguzzi
1 hour ago
add a comment |Â
up vote
3
down vote
@kglr was on the right track with PowerExpand
. With the default option Assumptions
->Automatic
, Mathematica may return a result that is not valid. On the other hand, if you give PowerExpand
a non-default assumption, then it will return a result valid given those assumptions. So, for your example:
Assuming[
x â Reals,
Simplify @ PowerExpand[ArcSin[Sin[x]], Assumptions -> x â Reals]
]
1/2 (-1)^(Ceiling[1/2 + x/ÃÂ] + Floor[-(1/2) + x/ÃÂ] +
Floor[1/2 + x/ÃÂ]) (ÃÂ + (-1)^(
Ceiling[1/2 + x/ÃÂ] + Floor[1/2 + x/ÃÂ]) ÃÂ + 2 x -
2 ÃÂ Floor[1/2 + x/ÃÂ])
Hello @CarlWoll, I have some difficult to interpret the solution. Can you explain me how it is related to the solution which I expected (the one in the question) please?
â Gennaro Arguzzi
1 hour ago
add a comment |Â
up vote
3
down vote
@kglr was on the right track with PowerExpand
. With the default option Assumptions
->Automatic
, Mathematica may return a result that is not valid. On the other hand, if you give PowerExpand
a non-default assumption, then it will return a result valid given those assumptions. So, for your example:
Assuming[
x â Reals,
Simplify @ PowerExpand[ArcSin[Sin[x]], Assumptions -> x â Reals]
]
1/2 (-1)^(Ceiling[1/2 + x/ÃÂ] + Floor[-(1/2) + x/ÃÂ] +
Floor[1/2 + x/ÃÂ]) (ÃÂ + (-1)^(
Ceiling[1/2 + x/ÃÂ] + Floor[1/2 + x/ÃÂ]) ÃÂ + 2 x -
2 ÃÂ Floor[1/2 + x/ÃÂ])
Hello @CarlWoll, I have some difficult to interpret the solution. Can you explain me how it is related to the solution which I expected (the one in the question) please?
â Gennaro Arguzzi
1 hour ago
add a comment |Â
up vote
3
down vote
up vote
3
down vote
@kglr was on the right track with PowerExpand
. With the default option Assumptions
->Automatic
, Mathematica may return a result that is not valid. On the other hand, if you give PowerExpand
a non-default assumption, then it will return a result valid given those assumptions. So, for your example:
Assuming[
x â Reals,
Simplify @ PowerExpand[ArcSin[Sin[x]], Assumptions -> x â Reals]
]
1/2 (-1)^(Ceiling[1/2 + x/ÃÂ] + Floor[-(1/2) + x/ÃÂ] +
Floor[1/2 + x/ÃÂ]) (ÃÂ + (-1)^(
Ceiling[1/2 + x/ÃÂ] + Floor[1/2 + x/ÃÂ]) ÃÂ + 2 x -
2 ÃÂ Floor[1/2 + x/ÃÂ])
@kglr was on the right track with PowerExpand
. With the default option Assumptions
->Automatic
, Mathematica may return a result that is not valid. On the other hand, if you give PowerExpand
a non-default assumption, then it will return a result valid given those assumptions. So, for your example:
Assuming[
x â Reals,
Simplify @ PowerExpand[ArcSin[Sin[x]], Assumptions -> x â Reals]
]
1/2 (-1)^(Ceiling[1/2 + x/ÃÂ] + Floor[-(1/2) + x/ÃÂ] +
Floor[1/2 + x/ÃÂ]) (ÃÂ + (-1)^(
Ceiling[1/2 + x/ÃÂ] + Floor[1/2 + x/ÃÂ]) ÃÂ + 2 x -
2 ÃÂ Floor[1/2 + x/ÃÂ])
edited 5 hours ago
answered 8 hours ago
Carl Woll
64.2k283167
64.2k283167
Hello @CarlWoll, I have some difficult to interpret the solution. Can you explain me how it is related to the solution which I expected (the one in the question) please?
â Gennaro Arguzzi
1 hour ago
add a comment |Â
Hello @CarlWoll, I have some difficult to interpret the solution. Can you explain me how it is related to the solution which I expected (the one in the question) please?
â Gennaro Arguzzi
1 hour ago
Hello @CarlWoll, I have some difficult to interpret the solution. Can you explain me how it is related to the solution which I expected (the one in the question) please?
â Gennaro Arguzzi
1 hour ago
Hello @CarlWoll, I have some difficult to interpret the solution. Can you explain me how it is related to the solution which I expected (the one in the question) please?
â Gennaro Arguzzi
1 hour ago
add a comment |Â
up vote
1
down vote
Plot[ArcSin[Sin[x]], ÃÂ/2 TriangleWave[x/(2 ÃÂ)], Abs[Mod[x - ÃÂ/2, 2 ÃÂ] - ÃÂ] - ÃÂ/2 +
0, -5, 5 // Evaluate,x, -10 ÃÂ, 10 ÃÂ]
With[x=RandomReal[-100,100,1000],
ArcSin[Sin[x]] - # //Chop//Union]& /@ ÃÂ/2 TriangleWave[x/(2 ÃÂ)], Abs[Mod[x-ÃÂ/2,2 ÃÂ]-ÃÂ]-ÃÂ/2
0, 0
add a comment |Â
up vote
1
down vote
Plot[ArcSin[Sin[x]], ÃÂ/2 TriangleWave[x/(2 ÃÂ)], Abs[Mod[x - ÃÂ/2, 2 ÃÂ] - ÃÂ] - ÃÂ/2 +
0, -5, 5 // Evaluate,x, -10 ÃÂ, 10 ÃÂ]
With[x=RandomReal[-100,100,1000],
ArcSin[Sin[x]] - # //Chop//Union]& /@ ÃÂ/2 TriangleWave[x/(2 ÃÂ)], Abs[Mod[x-ÃÂ/2,2 ÃÂ]-ÃÂ]-ÃÂ/2
0, 0
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Plot[ArcSin[Sin[x]], ÃÂ/2 TriangleWave[x/(2 ÃÂ)], Abs[Mod[x - ÃÂ/2, 2 ÃÂ] - ÃÂ] - ÃÂ/2 +
0, -5, 5 // Evaluate,x, -10 ÃÂ, 10 ÃÂ]
With[x=RandomReal[-100,100,1000],
ArcSin[Sin[x]] - # //Chop//Union]& /@ ÃÂ/2 TriangleWave[x/(2 ÃÂ)], Abs[Mod[x-ÃÂ/2,2 ÃÂ]-ÃÂ]-ÃÂ/2
0, 0
Plot[ArcSin[Sin[x]], ÃÂ/2 TriangleWave[x/(2 ÃÂ)], Abs[Mod[x - ÃÂ/2, 2 ÃÂ] - ÃÂ] - ÃÂ/2 +
0, -5, 5 // Evaluate,x, -10 ÃÂ, 10 ÃÂ]
With[x=RandomReal[-100,100,1000],
ArcSin[Sin[x]] - # //Chop//Union]& /@ ÃÂ/2 TriangleWave[x/(2 ÃÂ)], Abs[Mod[x-ÃÂ/2,2 ÃÂ]-ÃÂ]-ÃÂ/2
0, 0
edited 30 mins ago
answered 1 hour ago
chyanog
6,78921545
6,78921545
add a comment |Â
add a comment |Â
up vote
0
down vote
Answer to the first question
Simplify[x == ArcSin[Sin[x]], -Pi/2 <= x <= Pi/2]
(* True *)
Hello @UlrichNeumann, if possible i'd like to avoid to specify the range -Pi/2 <= x <= Pi/2. I prefer a more general statement because the above one is valid also for instance when Simplify[x == ArcSin[Sin[x]], 0 <= x <= Pi/2]
â Gennaro Arguzzi
9 hours ago
@Gennaro Arguzzi You want to proveArcSin[Sin[x]]=="triangle function"
?
â Ulrich Neumann
9 hours ago
I'm looking for built-in functions that allow me to "simplify" arcsin(sin(x)).
â Gennaro Arguzzi
9 hours ago
add a comment |Â
up vote
0
down vote
Answer to the first question
Simplify[x == ArcSin[Sin[x]], -Pi/2 <= x <= Pi/2]
(* True *)
Hello @UlrichNeumann, if possible i'd like to avoid to specify the range -Pi/2 <= x <= Pi/2. I prefer a more general statement because the above one is valid also for instance when Simplify[x == ArcSin[Sin[x]], 0 <= x <= Pi/2]
â Gennaro Arguzzi
9 hours ago
@Gennaro Arguzzi You want to proveArcSin[Sin[x]]=="triangle function"
?
â Ulrich Neumann
9 hours ago
I'm looking for built-in functions that allow me to "simplify" arcsin(sin(x)).
â Gennaro Arguzzi
9 hours ago
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Answer to the first question
Simplify[x == ArcSin[Sin[x]], -Pi/2 <= x <= Pi/2]
(* True *)
Answer to the first question
Simplify[x == ArcSin[Sin[x]], -Pi/2 <= x <= Pi/2]
(* True *)
answered 9 hours ago
Ulrich Neumann
5,617413
5,617413
Hello @UlrichNeumann, if possible i'd like to avoid to specify the range -Pi/2 <= x <= Pi/2. I prefer a more general statement because the above one is valid also for instance when Simplify[x == ArcSin[Sin[x]], 0 <= x <= Pi/2]
â Gennaro Arguzzi
9 hours ago
@Gennaro Arguzzi You want to proveArcSin[Sin[x]]=="triangle function"
?
â Ulrich Neumann
9 hours ago
I'm looking for built-in functions that allow me to "simplify" arcsin(sin(x)).
â Gennaro Arguzzi
9 hours ago
add a comment |Â
Hello @UlrichNeumann, if possible i'd like to avoid to specify the range -Pi/2 <= x <= Pi/2. I prefer a more general statement because the above one is valid also for instance when Simplify[x == ArcSin[Sin[x]], 0 <= x <= Pi/2]
â Gennaro Arguzzi
9 hours ago
@Gennaro Arguzzi You want to proveArcSin[Sin[x]]=="triangle function"
?
â Ulrich Neumann
9 hours ago
I'm looking for built-in functions that allow me to "simplify" arcsin(sin(x)).
â Gennaro Arguzzi
9 hours ago
Hello @UlrichNeumann, if possible i'd like to avoid to specify the range -Pi/2 <= x <= Pi/2. I prefer a more general statement because the above one is valid also for instance when Simplify[x == ArcSin[Sin[x]], 0 <= x <= Pi/2]
â Gennaro Arguzzi
9 hours ago
Hello @UlrichNeumann, if possible i'd like to avoid to specify the range -Pi/2 <= x <= Pi/2. I prefer a more general statement because the above one is valid also for instance when Simplify[x == ArcSin[Sin[x]], 0 <= x <= Pi/2]
â Gennaro Arguzzi
9 hours ago
@Gennaro Arguzzi You want to prove
ArcSin[Sin[x]]=="triangle function"
?â Ulrich Neumann
9 hours ago
@Gennaro Arguzzi You want to prove
ArcSin[Sin[x]]=="triangle function"
?â Ulrich Neumann
9 hours ago
I'm looking for built-in functions that allow me to "simplify" arcsin(sin(x)).
â Gennaro Arguzzi
9 hours ago
I'm looking for built-in functions that allow me to "simplify" arcsin(sin(x)).
â Gennaro Arguzzi
9 hours ago
add a comment |Â
up vote
0
down vote
An easy way is to define a new function sin
which will work as intended:
sin /: (ArcSin[sin[x :(_Real | _Integer| _Rational)]]
/;-(Pi/2)<=Mod[x, 2 Pi, -Pi/2] <= Pi/2) := x;
sin /: (ArcSin[sin[x :(_Real | _Integer| _Rational)]]
/; Pi/2<Mod[x, 2Pi,-Pi/2] < (3 Pi)/2) := Pi - x;
sin[x_] := Sin[x];
I intentionally restricted to real numbers (why I used heads Real
, Integer
, and Rational
) so that I can use Mod
.
Instead of trying to convert each Sin
to sin
, we can automate it by
$Pre = Function[# /. Sin -> sin];
Now, we do not have to do anything: The code works as expected. For example
Plot[ArcSin[Sin[x]], x, -Pi, 3 Pi]
add a comment |Â
up vote
0
down vote
An easy way is to define a new function sin
which will work as intended:
sin /: (ArcSin[sin[x :(_Real | _Integer| _Rational)]]
/;-(Pi/2)<=Mod[x, 2 Pi, -Pi/2] <= Pi/2) := x;
sin /: (ArcSin[sin[x :(_Real | _Integer| _Rational)]]
/; Pi/2<Mod[x, 2Pi,-Pi/2] < (3 Pi)/2) := Pi - x;
sin[x_] := Sin[x];
I intentionally restricted to real numbers (why I used heads Real
, Integer
, and Rational
) so that I can use Mod
.
Instead of trying to convert each Sin
to sin
, we can automate it by
$Pre = Function[# /. Sin -> sin];
Now, we do not have to do anything: The code works as expected. For example
Plot[ArcSin[Sin[x]], x, -Pi, 3 Pi]
add a comment |Â
up vote
0
down vote
up vote
0
down vote
An easy way is to define a new function sin
which will work as intended:
sin /: (ArcSin[sin[x :(_Real | _Integer| _Rational)]]
/;-(Pi/2)<=Mod[x, 2 Pi, -Pi/2] <= Pi/2) := x;
sin /: (ArcSin[sin[x :(_Real | _Integer| _Rational)]]
/; Pi/2<Mod[x, 2Pi,-Pi/2] < (3 Pi)/2) := Pi - x;
sin[x_] := Sin[x];
I intentionally restricted to real numbers (why I used heads Real
, Integer
, and Rational
) so that I can use Mod
.
Instead of trying to convert each Sin
to sin
, we can automate it by
$Pre = Function[# /. Sin -> sin];
Now, we do not have to do anything: The code works as expected. For example
Plot[ArcSin[Sin[x]], x, -Pi, 3 Pi]
An easy way is to define a new function sin
which will work as intended:
sin /: (ArcSin[sin[x :(_Real | _Integer| _Rational)]]
/;-(Pi/2)<=Mod[x, 2 Pi, -Pi/2] <= Pi/2) := x;
sin /: (ArcSin[sin[x :(_Real | _Integer| _Rational)]]
/; Pi/2<Mod[x, 2Pi,-Pi/2] < (3 Pi)/2) := Pi - x;
sin[x_] := Sin[x];
I intentionally restricted to real numbers (why I used heads Real
, Integer
, and Rational
) so that I can use Mod
.
Instead of trying to convert each Sin
to sin
, we can automate it by
$Pre = Function[# /. Sin -> sin];
Now, we do not have to do anything: The code works as expected. For example
Plot[ArcSin[Sin[x]], x, -Pi, 3 Pi]
answered 5 hours ago
Soner
77349
77349
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f185468%2falternative-form-of-arcsinsinx%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password