フィルターのクリア

How to get the simplified integral after using "piecewise"?

1 回表示 (過去 30 日間)
Asi angel
Asi angel 2021 年 5 月 26 日
編集済み: Asi angel 2021 年 5 月 26 日
Good morning,
I wrote a code by using "piecewise" function , but after that when I tried to get the result of any integration , I got the result as a function of piecewise
How to delete this " getting the result without piecewise" ?
Thanks alot
% Code
clc
clear all;
syms x w n
int((sin(x))*sin(x*n),x)
ans =
piecewise(n == 1, x/2 - sin(2*x)/4, n == -1, sin(2*x)/4 - x/2, ~n in {-1, 1}, sin(x*(n - 1))/(2*n - 2) - sin(x*(n + 1))/(2*n + 2))

採用された回答

Asi angel
Asi angel 2021 年 5 月 26 日
編集済み: Asi angel 2021 年 5 月 26 日
The answer:
int((sin(x))*sin(n*x),x,0,w,'IgnoreSpecialCases',true)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by