2024-08-30 06:50:13 +0200 | received badge | ● Famous Question (source) |

2022-07-06 06:29:56 +0200 | received badge | ● Notable Question (source) |

2019-10-20 13:58:14 +0200 | received badge | ● Popular Question (source) |

2016-09-25 19:51:47 +0200 | received badge | ● Famous Question (source) |

2013-10-03 19:44:34 +0200 | received badge | ● Notable Question (source) |

2013-03-26 09:04:01 +0200 | received badge | ● Popular Question (source) |

2012-10-23 07:35:57 +0200 | commented answer | Filtering an expression: keeping only term with even power @achrzesz Very flexible approach. Thank you. |

2012-10-23 07:34:50 +0200 | marked best answer | Filtering an expression: keeping only term with even power Is that what you need? |

2012-10-22 20:57:26 +0200 | marked best answer | Filtering an expression: keeping only term with even power Here is an answer using the This will also keep the coefficients. |

2012-10-22 20:42:54 +0200 | commented answer | Filtering an expression: keeping only term with even power @archrzesz Exactly what I want, thank you. Is there a way to keep the coefficient of each monomial? For example, return $5 x^4 y^4$. |

2012-10-22 19:26:25 +0200 | asked a question | Filtering an expression: keeping only term with even power In the expression $$ x^2 y^2+x y^2+x^3y + 5 x^4 y^4 $$ I would like to keep only the term where the variables have even power $$ x^2y^2+5 x^4 y^4 $$ Is there a way to do it? I look into this post. |

2012-01-29 00:55:07 +0200 | received badge | ● Nice Question (source) |

2011-12-21 20:18:47 +0200 | commented answer | Programming with Sage: defining module @Shashank Thanks Shashank. |

2011-12-21 20:17:38 +0200 | marked best answer | Programming with Sage: defining module If result.sage is calling add function from addition.sage, you need to load that file in result.sage. You can also load the file without giving the path, if you type the following two lines in the beginning of the notebook |

2011-12-21 15:54:04 +0200 | received badge | ● Editor (source) |

2011-12-21 15:52:47 +0200 | asked a question | Programming with Sage: defining module Let's say I want to write two modules 'addition.sage' and 'result.sage'. 'addition.sage' file: 'result.sage' file: my sage session: This gives me the error 'ImportError: No module named addition'. |

2011-12-20 10:37:42 +0200 | commented answer | Defining a function of the form $f(x_1,x_2,...,x_n)=\sum_{i=0}^n x_i$ @DSM Thanks DSM, your answer is enlightening |

2011-12-20 10:35:59 +0200 | received badge | ● Supporter (source) |

2011-12-20 10:35:56 +0200 | marked best answer | Defining a function of the form $f(x_1,x_2,...,x_n)=\sum_{i=0}^n x_i$ You're getting the TypeError because you're double-assigning x: in your second line, you make it a list of variables, but in the third you redefine it as a symbolic variable. The f(x)=sum(x[i],i,0,n) line is translated as Unfortunately we can't simply rename x to xx: the "f(x,y) = x+y" syntax requires explicit specification of the variables, and you can't pass it a list. So for a fixed n (which is the only case I really know how to handle offhand) I would probably do this instead: [Here I took advantage of the * operator in Oh, I've just noticed that I used [0..n-1] as the indices and I think you're using [0..n], but that's easy to change. |

2011-12-20 10:35:56 +0200 | received badge | ● Scholar (source) |

2011-12-20 10:12:47 +0200 | received badge | ● Student (source) |

2011-12-20 09:52:14 +0200 | asked a question | Defining a function of the form $f(x_1,x_2,...,x_n)=\sum_{i=0}^n x_i$ How can I define a function of the form
$$f(x_1,x_2,...,x_n)=\sum_{i=0}^n x_i$$
I tried the following |

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.